﻿<!--
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.
-->

<UserControl x:Class="System.Windows.Controls.Samples.ButtonSpinnerSample"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:inputToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"
xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
    
    >
    <UserControl.Resources>
        <Style x:Key="ButtonSpinnerHorizontalStyle" TargetType="inputToolkit:ButtonSpinner">
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="inputToolkit:ButtonSpinner">
                        <Grid>
                            <Grid.Resources>
                                <ControlTemplate x:Key="IncreaseButtonTemplate" TargetType="RepeatButton">
                                    <Grid x:Name="Root">
                                        <vsm:VisualStateManager.VisualStateGroups>
                                            <vsm:VisualStateGroup x:Name="CommonStates">
                                                <vsm:VisualStateGroup.Transitions>
                                                    <vsm:VisualTransition GeneratedDuration="0"/>
                                                    <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/>
                                                    <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/>
                                                </vsm:VisualStateGroup.Transitions>
                                                <vsm:VisualState x:Name="Normal"/>
                                                <vsm:VisualState x:Name="MouseOver">
                                                    <Storyboard>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#FF448DCA"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#F2FFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#CCFFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#7FFFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </vsm:VisualState>
                                                <vsm:VisualState x:Name="Pressed">
                                                    <Storyboard>
                                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                                        </DoubleAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#FF448DCA"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#F4FFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#EAFFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#C6FFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#6BFFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </vsm:VisualState>
                                            </vsm:VisualStateGroup>
                                            <vsm:VisualStateGroup x:Name="FocusStates">
                                                <vsm:VisualState x:Name="Focused">
                                                    <Storyboard>
                                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                        </ObjectAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </vsm:VisualState>
                                                <vsm:VisualState x:Name="Unfocused"/>
                                            </vsm:VisualStateGroup>
                                        </vsm:VisualStateManager.VisualStateGroups>
                                        <Rectangle x:Name="Background" RadiusX="2" RadiusY="2" Fill="{TemplateBinding Background}" StrokeThickness="1">
                                            <Rectangle.Stroke>
                                                <LinearGradientBrush EndPoint=".5,1" StartPoint=".5,0">
                                                    <GradientStop Color="#FFAEB7BF" Offset="0"/>
                                                    <GradientStop Color="#FF919EA7" Offset="0.35"/>
                                                    <GradientStop Color="#FF7A8A99" Offset="0.35"/>
                                                    <GradientStop Color="#FF647480" Offset="1"/>
                                                </LinearGradientBrush>
                                            </Rectangle.Stroke>
                                        </Rectangle>
                                        <Rectangle Margin="1" x:Name="BackgroundGradient" RadiusX="1" RadiusY="1" Stroke="#FFFFFFFF" StrokeThickness="1">
                                            <Rectangle.Fill>
                                                <LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
                                                    <GradientStop Color="#FFFFFFFF" Offset="0"/>
                                                    <GradientStop Color="#F9FFFFFF" Offset="0.375"/>
                                                    <GradientStop Color="#E5FFFFFF" Offset="0.625"/>
                                                    <GradientStop Color="#C6FFFFFF" Offset="1"/>
                                                </LinearGradientBrush>
                                            </Rectangle.Fill>
                                        </Rectangle>
                                        <Rectangle Margin="1" x:Name="Highlight" IsHitTestVisible="false" Opacity="0" RadiusX="1" RadiusY="1" Stroke="#FF45D6FA" StrokeThickness="1"/>
                                        <Rectangle x:Name="FocusVisualElement" IsHitTestVisible="false" Visibility="Collapsed" RadiusX="1" RadiusY="1" Stroke="#FF45D6FA" StrokeThickness="1"/>
                                        <Path HorizontalAlignment="Stretch" Margin="4,3,4,3" VerticalAlignment="Stretch" Fill="#FF333333" Stretch="Uniform" Data="F1 M 541.537,173.589L 531.107,173.589L 536.322,167.49L 541.537,173.589 Z "/>
                                    </Grid>
                                </ControlTemplate>
                                <ControlTemplate x:Key="DecreaseButtonTemplate" TargetType="RepeatButton">
                                    <Grid x:Name="Root">
                                        <vsm:VisualStateManager.VisualStateGroups>
                                            <vsm:VisualStateGroup x:Name="CommonStates">
                                                <vsm:VisualStateGroup.Transitions>
                                                    <vsm:VisualTransition GeneratedDuration="0"/>
                                                    <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/>
                                                    <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/>
                                                </vsm:VisualStateGroup.Transitions>
                                                <vsm:VisualState x:Name="Normal"/>
                                                <vsm:VisualState x:Name="MouseOver">
                                                    <Storyboard>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#FF448DCA"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#F2FFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#CCFFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#7FFFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </vsm:VisualState>
                                                <vsm:VisualState x:Name="Pressed">
                                                    <Storyboard>
                                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                                        </DoubleAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#FF448DCA"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#F4FFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#EAFFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#C6FFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#6BFFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </vsm:VisualState>
                                            </vsm:VisualStateGroup>
                                            <vsm:VisualStateGroup x:Name="FocusStates">
                                                <vsm:VisualState x:Name="Focused">
                                                    <Storyboard>
                                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                        </ObjectAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </vsm:VisualState>
                                                <vsm:VisualState x:Name="Unfocused"/>
                                            </vsm:VisualStateGroup>
                                        </vsm:VisualStateManager.VisualStateGroups>
                                        <Rectangle x:Name="Background" RadiusX="2" RadiusY="2" Fill="{TemplateBinding Background}" StrokeThickness="1">
                                            <Rectangle.Stroke>
                                                <LinearGradientBrush EndPoint=".5,1" StartPoint=".5,0">
                                                    <GradientStop Color="#FFAEB7BF" Offset="0"/>
                                                    <GradientStop Color="#FF919EA7" Offset="0.35"/>
                                                    <GradientStop Color="#FF7A8A99" Offset="0.35"/>
                                                    <GradientStop Color="#FF647480" Offset="1"/>
                                                </LinearGradientBrush>
                                            </Rectangle.Stroke>
                                        </Rectangle>
                                        <Rectangle Margin="1" x:Name="BackgroundGradient" RadiusX="1" RadiusY="1" Stroke="#FFFFFFFF" StrokeThickness="1">
                                            <Rectangle.Fill>
                                                <LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
                                                    <GradientStop Color="#FFFFFFFF" Offset="0"/>
                                                    <GradientStop Color="#F9FFFFFF" Offset="0.375"/>
                                                    <GradientStop Color="#E5FFFFFF" Offset="0.625"/>
                                                    <GradientStop Color="#C6FFFFFF" Offset="1"/>
                                                </LinearGradientBrush>
                                            </Rectangle.Fill>
                                        </Rectangle>
                                        <Rectangle Margin="1" x:Name="Highlight" IsHitTestVisible="false" Opacity="0" RadiusX="1" RadiusY="1" Stroke="#FF45D6FA" StrokeThickness="1"/>
                                        <Rectangle x:Name="FocusVisualElement" IsHitTestVisible="false" Visibility="Collapsed" RadiusX="1" RadiusY="1" Stroke="#FF45D6FA" StrokeThickness="1"/>
                                        <Path Height="Auto" HorizontalAlignment="Stretch" Margin="4,3,4,3" VerticalAlignment="Stretch" Width="Auto" Fill="#FF333333" Stretch="Uniform" Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z "/>
                                    </Grid>
                                </ControlTemplate>
                            </Grid.Resources>
                            <vsm:VisualStateManager.VisualStateGroups>
                                <vsm:VisualStateGroup x:Name="CommonStates">
                                    <vsm:VisualStateGroup.Transitions>
                                        <vsm:VisualTransition GeneratedDuration="0"/>
                                    </vsm:VisualStateGroup.Transitions>
                                    <vsm:VisualState x:Name="Normal"/>
                                    <vsm:VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)" To="1"/>
                                        </Storyboard>
                                    </vsm:VisualState>
                                </vsm:VisualStateGroup>
                                <vsm:VisualStateGroup x:Name="FocusStates">
                                    <vsm:VisualState x:Name="Focused">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                    <vsm:VisualState x:Name="Unfocused"/>
                                </vsm:VisualStateGroup>
                            </vsm:VisualStateManager.VisualStateGroups>
                            <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" Grid.Column="1"/>
                                    <RepeatButton IsTabStop="False" Template="{StaticResource IncreaseButtonTemplate}" x:Name="IncreaseButton" ClickMode="Press"/>
                                    <RepeatButton IsTabStop="False" Template="{StaticResource DecreaseButtonTemplate}" x:Name="DecreaseButton" ClickMode="Press" Grid.Column="2"/>
                                </Grid>
                            </Border>
                            <Border x:Name="DisabledVisualElement" IsHitTestVisible="false" Opacity="0" Background="#A5FFFFFF" CornerRadius="3"/>
                            <Border x:Name="FocusVisualElement" IsHitTestVisible="false" Visibility="Collapsed" BorderBrush="#FF45D6FA" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="1,1,1,1"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="ButtonSpinnerVerticalStyle" TargetType="inputToolkit:ButtonSpinner">
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="inputToolkit:ButtonSpinner">
                        <Grid>
                            <Grid.Resources>
                                <ControlTemplate x:Key="IncreaseButtonTemplate" TargetType="RepeatButton">
                                    <Grid x:Name="Root">
                                        <vsm:VisualStateManager.VisualStateGroups>
                                            <vsm:VisualStateGroup x:Name="CommonStates">
                                                <vsm:VisualStateGroup.Transitions>
                                                    <vsm:VisualTransition GeneratedDuration="0"/>
                                                    <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/>
                                                    <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/>
                                                </vsm:VisualStateGroup.Transitions>
                                                <vsm:VisualState x:Name="Normal"/>
                                                <vsm:VisualState x:Name="MouseOver">
                                                    <Storyboard>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#FF448DCA"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#F2FFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#CCFFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#7FFFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </vsm:VisualState>
                                                <vsm:VisualState x:Name="Pressed">
                                                    <Storyboard>
                                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                                        </DoubleAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#FF448DCA"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#F4FFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#EAFFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#C6FFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#6BFFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </vsm:VisualState>
                                            </vsm:VisualStateGroup>
                                            <vsm:VisualStateGroup x:Name="FocusStates">
                                                <vsm:VisualState x:Name="Focused">
                                                    <Storyboard>
                                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                        </ObjectAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </vsm:VisualState>
                                                <vsm:VisualState x:Name="Unfocused"/>
                                            </vsm:VisualStateGroup>
                                        </vsm:VisualStateManager.VisualStateGroups>
                                        <Rectangle x:Name="Background" RadiusX="2" RadiusY="2" Fill="{TemplateBinding Background}" StrokeThickness="1">
                                            <Rectangle.Stroke>
                                                <LinearGradientBrush EndPoint=".5,1" StartPoint=".5,0">
                                                    <GradientStop Color="#FFAEB7BF" Offset="0"/>
                                                    <GradientStop Color="#FF919EA7" Offset="0.35"/>
                                                    <GradientStop Color="#FF7A8A99" Offset="0.35"/>
                                                    <GradientStop Color="#FF647480" Offset="1"/>
                                                </LinearGradientBrush>
                                            </Rectangle.Stroke>
                                        </Rectangle>
                                        <Rectangle Margin="1" x:Name="BackgroundGradient" RadiusX="1" RadiusY="1" Stroke="#FFFFFFFF" StrokeThickness="1">
                                            <Rectangle.Fill>
                                                <LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
                                                    <GradientStop Color="#FFFFFFFF" Offset="0"/>
                                                    <GradientStop Color="#F9FFFFFF" Offset="0.375"/>
                                                    <GradientStop Color="#E5FFFFFF" Offset="0.625"/>
                                                    <GradientStop Color="#C6FFFFFF" Offset="1"/>
                                                </LinearGradientBrush>
                                            </Rectangle.Fill>
                                        </Rectangle>
                                        <Rectangle Margin="1" x:Name="Highlight" IsHitTestVisible="false" Opacity="0" RadiusX="1" RadiusY="1" Stroke="#FF45D6FA" StrokeThickness="1"/>
                                        <Rectangle x:Name="FocusVisualElement" IsHitTestVisible="false" Visibility="Collapsed" RadiusX="1" RadiusY="1" Stroke="#FF45D6FA" StrokeThickness="1"/>
                                        <Path HorizontalAlignment="Stretch" Margin="4,3,4,3" VerticalAlignment="Stretch" Fill="#FF333333" Stretch="Uniform" Data="F1 M 541.537,173.589L 531.107,173.589L 536.322,167.49L 541.537,173.589 Z "/>
                                    </Grid>
                                </ControlTemplate>
                                <ControlTemplate x:Key="DecreaseButtonTemplate" TargetType="RepeatButton">
                                    <Grid x:Name="Root">
                                        <vsm:VisualStateManager.VisualStateGroups>
                                            <vsm:VisualStateGroup x:Name="CommonStates">
                                                <vsm:VisualStateGroup.Transitions>
                                                    <vsm:VisualTransition GeneratedDuration="0"/>
                                                    <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/>
                                                    <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/>
                                                </vsm:VisualStateGroup.Transitions>
                                                <vsm:VisualState x:Name="Normal"/>
                                                <vsm:VisualState x:Name="MouseOver">
                                                    <Storyboard>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#FF448DCA"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#F2FFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#CCFFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#7FFFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </vsm:VisualState>
                                                <vsm:VisualState x:Name="Pressed">
                                                    <Storyboard>
                                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                                        </DoubleAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#FF448DCA"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#F4FFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#EAFFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#C6FFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#6BFFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </vsm:VisualState>
                                            </vsm:VisualStateGroup>
                                            <vsm:VisualStateGroup x:Name="FocusStates">
                                                <vsm:VisualState x:Name="Focused">
                                                    <Storyboard>
                                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                        </ObjectAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </vsm:VisualState>
                                                <vsm:VisualState x:Name="Unfocused"/>
                                            </vsm:VisualStateGroup>
                                        </vsm:VisualStateManager.VisualStateGroups>
                                        <Rectangle x:Name="Background" RadiusX="2" RadiusY="2" Fill="{TemplateBinding Background}" StrokeThickness="1">
                                            <Rectangle.Stroke>
                                                <LinearGradientBrush EndPoint=".5,1" StartPoint=".5,0">
                                                    <GradientStop Color="#FFAEB7BF" Offset="0"/>
                                                    <GradientStop Color="#FF919EA7" Offset="0.35"/>
                                                    <GradientStop Color="#FF7A8A99" Offset="0.35"/>
                                                    <GradientStop Color="#FF647480" Offset="1"/>
                                                </LinearGradientBrush>
                                            </Rectangle.Stroke>
                                        </Rectangle>
                                        <Rectangle Margin="1" x:Name="BackgroundGradient" RadiusX="1" RadiusY="1" Stroke="#FFFFFFFF" StrokeThickness="1">
                                            <Rectangle.Fill>
                                                <LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
                                                    <GradientStop Color="#FFFFFFFF" Offset="0"/>
                                                    <GradientStop Color="#F9FFFFFF" Offset="0.375"/>
                                                    <GradientStop Color="#E5FFFFFF" Offset="0.625"/>
                                                    <GradientStop Color="#C6FFFFFF" Offset="1"/>
                                                </LinearGradientBrush>
                                            </Rectangle.Fill>
                                        </Rectangle>
                                        <Rectangle Margin="1" x:Name="Highlight" IsHitTestVisible="false" Opacity="0" RadiusX="1" RadiusY="1" Stroke="#FF45D6FA" StrokeThickness="1"/>
                                        <Rectangle x:Name="FocusVisualElement" IsHitTestVisible="false" Visibility="Collapsed" RadiusX="1" RadiusY="1" Stroke="#FF45D6FA" StrokeThickness="1"/>
                                        <Path Height="Auto" HorizontalAlignment="Stretch" Margin="4,3,4,3" VerticalAlignment="Stretch" Width="Auto" Fill="#FF333333" Stretch="Uniform" Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z "/>
                                    </Grid>
                                </ControlTemplate>
                            </Grid.Resources>
                            <vsm:VisualStateManager.VisualStateGroups>
                                <vsm:VisualStateGroup x:Name="CommonStates">
                                    <vsm:VisualStateGroup.Transitions>
                                        <vsm:VisualTransition GeneratedDuration="0"/>
                                    </vsm:VisualStateGroup.Transitions>
                                    <vsm:VisualState x:Name="Normal"/>
                                    <vsm:VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)" To="1"/>
                                        </Storyboard>
                                    </vsm:VisualState>
                                </vsm:VisualStateGroup>
                                <vsm:VisualStateGroup x:Name="FocusStates">
                                    <vsm:VisualState x:Name="Focused">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                    <vsm:VisualState x:Name="Unfocused"/>
                                </vsm:VisualStateGroup>
                            </vsm:VisualStateManager.VisualStateGroups>
                            <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="*"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="*"/>
                                    </Grid.RowDefinitions>
                                    <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" Grid.Row="1"/>
                                    <RepeatButton IsTabStop="False" Template="{StaticResource IncreaseButtonTemplate}" x:Name="IncreaseButton" ClickMode="Press"/>
                                    <RepeatButton IsTabStop="False" Template="{StaticResource DecreaseButtonTemplate}" x:Name="DecreaseButton" ClickMode="Press" Grid.Row="2"/>
                                </Grid>
                            </Border>
                            <Border x:Name="DisabledVisualElement" IsHitTestVisible="false" Opacity="0" Background="#A5FFFFFF" CornerRadius="3"/>
                            <Border x:Name="FocusVisualElement" IsHitTestVisible="false" Visibility="Collapsed" BorderBrush="#FF45D6FA" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="1,1,1,1"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ButtonSpinnerLeftyStyle" TargetType="inputToolkit:ButtonSpinner">
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="inputToolkit:ButtonSpinner">
                        <Grid>
                            <Grid.Resources>
                                <ControlTemplate x:Key="IncreaseButtonTemplate" TargetType="RepeatButton">
                                    <Grid x:Name="Root">
                                        <vsm:VisualStateManager.VisualStateGroups>
                                            <vsm:VisualStateGroup x:Name="CommonStates">
                                                <vsm:VisualStateGroup.Transitions>
                                                    <vsm:VisualTransition GeneratedDuration="0"/>
                                                    <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/>
                                                    <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/>
                                                </vsm:VisualStateGroup.Transitions>
                                                <vsm:VisualState x:Name="Normal"/>
                                                <vsm:VisualState x:Name="MouseOver">
                                                    <Storyboard>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#FF448DCA"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#F2FFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#CCFFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#7FFFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </vsm:VisualState>
                                                <vsm:VisualState x:Name="Pressed">
                                                    <Storyboard>
                                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                                        </DoubleAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#FF448DCA"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#F4FFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#EAFFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#C6FFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#6BFFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </vsm:VisualState>
                                            </vsm:VisualStateGroup>
                                            <vsm:VisualStateGroup x:Name="FocusStates">
                                                <vsm:VisualState x:Name="Focused">
                                                    <Storyboard>
                                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                        </ObjectAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </vsm:VisualState>
                                                <vsm:VisualState x:Name="Unfocused"/>
                                            </vsm:VisualStateGroup>
                                        </vsm:VisualStateManager.VisualStateGroups>
                                        <Rectangle x:Name="Background" RadiusX="2" RadiusY="2" Fill="{TemplateBinding Background}" StrokeThickness="1">
                                            <Rectangle.Stroke>
                                                <LinearGradientBrush EndPoint=".5,1" StartPoint=".5,0">
                                                    <GradientStop Color="#FFAEB7BF" Offset="0"/>
                                                    <GradientStop Color="#FF919EA7" Offset="0.35"/>
                                                    <GradientStop Color="#FF7A8A99" Offset="0.35"/>
                                                    <GradientStop Color="#FF647480" Offset="1"/>
                                                </LinearGradientBrush>
                                            </Rectangle.Stroke>
                                        </Rectangle>
                                        <Rectangle Margin="1" x:Name="BackgroundGradient" RadiusX="1" RadiusY="1" Stroke="#FFFFFFFF" StrokeThickness="1">
                                            <Rectangle.Fill>
                                                <LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
                                                    <GradientStop Color="#FFFFFFFF" Offset="0"/>
                                                    <GradientStop Color="#F9FFFFFF" Offset="0.375"/>
                                                    <GradientStop Color="#E5FFFFFF" Offset="0.625"/>
                                                    <GradientStop Color="#C6FFFFFF" Offset="1"/>
                                                </LinearGradientBrush>
                                            </Rectangle.Fill>
                                        </Rectangle>
                                        <Rectangle Margin="1" x:Name="Highlight" IsHitTestVisible="false" Opacity="0" RadiusX="1" RadiusY="1" Stroke="#FF45D6FA" StrokeThickness="1"/>
                                        <Rectangle x:Name="FocusVisualElement" IsHitTestVisible="false" Visibility="Collapsed" RadiusX="1" RadiusY="1" Stroke="#FF45D6FA" StrokeThickness="1"/>
                                        <Path HorizontalAlignment="Stretch" Margin="4,3,4,3" VerticalAlignment="Stretch" Fill="#FF333333" Stretch="Uniform" Data="F1 M 541.537,173.589L 531.107,173.589L 536.322,167.49L 541.537,173.589 Z "/>
                                    </Grid>
                                </ControlTemplate>
                                <ControlTemplate x:Key="DecreaseButtonTemplate" TargetType="RepeatButton">
                                    <Grid x:Name="Root">
                                        <vsm:VisualStateManager.VisualStateGroups>
                                            <vsm:VisualStateGroup x:Name="CommonStates">
                                                <vsm:VisualStateGroup.Transitions>
                                                    <vsm:VisualTransition GeneratedDuration="0"/>
                                                    <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/>
                                                    <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/>
                                                </vsm:VisualStateGroup.Transitions>
                                                <vsm:VisualState x:Name="Normal"/>
                                                <vsm:VisualState x:Name="MouseOver">
                                                    <Storyboard>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#FF448DCA"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#F2FFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#CCFFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#7FFFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </vsm:VisualState>
                                                <vsm:VisualState x:Name="Pressed">
                                                    <Storyboard>
                                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                                        </DoubleAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#FF448DCA"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#F4FFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#EAFFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#C6FFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#6BFFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </vsm:VisualState>
                                            </vsm:VisualStateGroup>
                                            <vsm:VisualStateGroup x:Name="FocusStates">
                                                <vsm:VisualState x:Name="Focused">
                                                    <Storyboard>
                                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                        </ObjectAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </vsm:VisualState>
                                                <vsm:VisualState x:Name="Unfocused"/>
                                            </vsm:VisualStateGroup>
                                        </vsm:VisualStateManager.VisualStateGroups>
                                        <Rectangle x:Name="Background" RadiusX="2" RadiusY="2" Fill="{TemplateBinding Background}" StrokeThickness="1">
                                            <Rectangle.Stroke>
                                                <LinearGradientBrush EndPoint=".5,1" StartPoint=".5,0">
                                                    <GradientStop Color="#FFAEB7BF" Offset="0"/>
                                                    <GradientStop Color="#FF919EA7" Offset="0.35"/>
                                                    <GradientStop Color="#FF7A8A99" Offset="0.35"/>
                                                    <GradientStop Color="#FF647480" Offset="1"/>
                                                </LinearGradientBrush>
                                            </Rectangle.Stroke>
                                        </Rectangle>
                                        <Rectangle Margin="1" x:Name="BackgroundGradient" RadiusX="1" RadiusY="1" Stroke="#FFFFFFFF" StrokeThickness="1">
                                            <Rectangle.Fill>
                                                <LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
                                                    <GradientStop Color="#FFFFFFFF" Offset="0"/>
                                                    <GradientStop Color="#F9FFFFFF" Offset="0.375"/>
                                                    <GradientStop Color="#E5FFFFFF" Offset="0.625"/>
                                                    <GradientStop Color="#C6FFFFFF" Offset="1"/>
                                                </LinearGradientBrush>
                                            </Rectangle.Fill>
                                        </Rectangle>
                                        <Rectangle Margin="1" x:Name="Highlight" IsHitTestVisible="false" Opacity="0" RadiusX="1" RadiusY="1" Stroke="#FF45D6FA" StrokeThickness="1"/>
                                        <Rectangle x:Name="FocusVisualElement" IsHitTestVisible="false" Visibility="Collapsed" RadiusX="1" RadiusY="1" Stroke="#FF45D6FA" StrokeThickness="1"/>
                                        <Path Height="Auto" HorizontalAlignment="Stretch" Margin="4,3,4,3" VerticalAlignment="Stretch" Width="Auto" Fill="#FF333333" Stretch="Uniform" Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z "/>
                                    </Grid>
                                </ControlTemplate>
                            </Grid.Resources>
                            <vsm:VisualStateManager.VisualStateGroups>
                                <vsm:VisualStateGroup x:Name="CommonStates">
                                    <vsm:VisualStateGroup.Transitions>
                                        <vsm:VisualTransition GeneratedDuration="0"/>
                                    </vsm:VisualStateGroup.Transitions>
                                    <vsm:VisualState x:Name="Normal"/>
                                    <vsm:VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)" To="1"/>
                                        </Storyboard>
                                    </vsm:VisualState>
                                </vsm:VisualStateGroup>
                                <vsm:VisualStateGroup x:Name="FocusStates">
                                    <vsm:VisualState x:Name="Focused">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                    <vsm:VisualState x:Name="Unfocused"/>
                                </vsm:VisualStateGroup>
                            </vsm:VisualStateManager.VisualStateGroups>
                            <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="15"/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition/>
                                        <RowDefinition/>
                                    </Grid.RowDefinitions>
                                    <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" Grid.Column="1" Grid.RowSpan="2"/>
                                    <RepeatButton x:Name="IncreaseButton" IsTabStop="False" Template="{StaticResource IncreaseButtonTemplate}" Grid.Column="0" Grid.Row="0" ClickMode="Press"/>
                                    <RepeatButton x:Name="DecreaseButton" IsTabStop="False" Template="{StaticResource DecreaseButtonTemplate}" Grid.Column="0" Grid.Row="1" ClickMode="Press"/>
                                </Grid>
                            </Border>
                            <Border x:Name="DisabledVisualElement" IsHitTestVisible="false" Opacity="0" Background="#A5FFFFFF" CornerRadius="3"/>
                            <Border x:Name="FocusVisualElement" IsHitTestVisible="false" Visibility="Collapsed" BorderBrush="#FF45D6FA" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="1,1,1,1"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ButtonSpinnerTopStyle" TargetType="inputToolkit:ButtonSpinner">
            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
            <Setter Property="VerticalContentAlignment" Value="Stretch"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="inputToolkit:ButtonSpinner">
                        <Grid>
                            <Grid.Resources>
                                <ControlTemplate x:Key="IncreaseButtonTemplate" TargetType="RepeatButton">
                                    <Grid x:Name="Root">
                                        <vsm:VisualStateManager.VisualStateGroups>
                                            <vsm:VisualStateGroup x:Name="CommonStates">
                                                <vsm:VisualStateGroup.Transitions>
                                                    <vsm:VisualTransition GeneratedDuration="0"/>
                                                    <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/>
                                                    <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/>
                                                </vsm:VisualStateGroup.Transitions>
                                                <vsm:VisualState x:Name="Normal"/>
                                                <vsm:VisualState x:Name="MouseOver">
                                                    <Storyboard>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#FF448DCA"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#F2FFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#CCFFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#7FFFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </vsm:VisualState>
                                                <vsm:VisualState x:Name="Pressed">
                                                    <Storyboard>
                                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                                        </DoubleAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#FF448DCA"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#F4FFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#EAFFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#C6FFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#6BFFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </vsm:VisualState>
                                            </vsm:VisualStateGroup>
                                            <vsm:VisualStateGroup x:Name="FocusStates">
                                                <vsm:VisualState x:Name="Focused">
                                                    <Storyboard>
                                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                        </ObjectAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </vsm:VisualState>
                                                <vsm:VisualState x:Name="Unfocused"/>
                                            </vsm:VisualStateGroup>
                                        </vsm:VisualStateManager.VisualStateGroups>
                                        <Rectangle x:Name="Background" RadiusX="2" RadiusY="2" Fill="{TemplateBinding Background}" StrokeThickness="1">
                                            <Rectangle.Stroke>
                                                <LinearGradientBrush EndPoint=".5,1" StartPoint=".5,0">
                                                    <GradientStop Color="#FFAEB7BF" Offset="0"/>
                                                    <GradientStop Color="#FF919EA7" Offset="0.35"/>
                                                    <GradientStop Color="#FF7A8A99" Offset="0.35"/>
                                                    <GradientStop Color="#FF647480" Offset="1"/>
                                                </LinearGradientBrush>
                                            </Rectangle.Stroke>
                                        </Rectangle>
                                        <Rectangle Margin="1" x:Name="BackgroundGradient" RadiusX="1" RadiusY="1" Stroke="#FFFFFFFF" StrokeThickness="1">
                                            <Rectangle.Fill>
                                                <LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
                                                    <GradientStop Color="#FFFFFFFF" Offset="0"/>
                                                    <GradientStop Color="#F9FFFFFF" Offset="0.375"/>
                                                    <GradientStop Color="#E5FFFFFF" Offset="0.625"/>
                                                    <GradientStop Color="#C6FFFFFF" Offset="1"/>
                                                </LinearGradientBrush>
                                            </Rectangle.Fill>
                                        </Rectangle>
                                        <Rectangle Margin="1" x:Name="Highlight" IsHitTestVisible="false" Opacity="0" RadiusX="1" RadiusY="1" Stroke="#FF45D6FA" StrokeThickness="1"/>
                                        <Rectangle x:Name="FocusVisualElement" IsHitTestVisible="false" Visibility="Collapsed" RadiusX="1" RadiusY="1" Stroke="#FF45D6FA" StrokeThickness="1"/>
                                        <Path HorizontalAlignment="Stretch" Margin="4,3,4,3" VerticalAlignment="Stretch" Fill="#FF333333" Stretch="Uniform" Data="F1 M 541.537,173.589L 531.107,173.589L 536.322,167.49L 541.537,173.589 Z "/>
                                    </Grid>
                                </ControlTemplate>
                                <ControlTemplate x:Key="DecreaseButtonTemplate" TargetType="RepeatButton">
                                    <Grid x:Name="Root">
                                        <vsm:VisualStateManager.VisualStateGroups>
                                            <vsm:VisualStateGroup x:Name="CommonStates">
                                                <vsm:VisualStateGroup.Transitions>
                                                    <vsm:VisualTransition GeneratedDuration="0"/>
                                                    <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/>
                                                    <vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/>
                                                </vsm:VisualStateGroup.Transitions>
                                                <vsm:VisualState x:Name="Normal"/>
                                                <vsm:VisualState x:Name="MouseOver">
                                                    <Storyboard>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#FF448DCA"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#F2FFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#CCFFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#7FFFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </vsm:VisualState>
                                                <vsm:VisualState x:Name="Pressed">
                                                    <Storyboard>
                                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                                        </DoubleAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#FF448DCA"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#F4FFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#EAFFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#C6FFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="00:00:00" Value="#6BFFFFFF"/>
                                                        </ColorAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </vsm:VisualState>
                                            </vsm:VisualStateGroup>
                                            <vsm:VisualStateGroup x:Name="FocusStates">
                                                <vsm:VisualState x:Name="Focused">
                                                    <Storyboard>
                                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                        </ObjectAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </vsm:VisualState>
                                                <vsm:VisualState x:Name="Unfocused"/>
                                            </vsm:VisualStateGroup>
                                        </vsm:VisualStateManager.VisualStateGroups>
                                        <Rectangle x:Name="Background" RadiusX="2" RadiusY="2" Fill="{TemplateBinding Background}" StrokeThickness="1">
                                            <Rectangle.Stroke>
                                                <LinearGradientBrush EndPoint=".5,1" StartPoint=".5,0">
                                                    <GradientStop Color="#FFAEB7BF" Offset="0"/>
                                                    <GradientStop Color="#FF919EA7" Offset="0.35"/>
                                                    <GradientStop Color="#FF7A8A99" Offset="0.35"/>
                                                    <GradientStop Color="#FF647480" Offset="1"/>
                                                </LinearGradientBrush>
                                            </Rectangle.Stroke>
                                        </Rectangle>
                                        <Rectangle Margin="1" x:Name="BackgroundGradient" RadiusX="1" RadiusY="1" Stroke="#FFFFFFFF" StrokeThickness="1">
                                            <Rectangle.Fill>
                                                <LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
                                                    <GradientStop Color="#FFFFFFFF" Offset="0"/>
                                                    <GradientStop Color="#F9FFFFFF" Offset="0.375"/>
                                                    <GradientStop Color="#E5FFFFFF" Offset="0.625"/>
                                                    <GradientStop Color="#C6FFFFFF" Offset="1"/>
                                                </LinearGradientBrush>
                                            </Rectangle.Fill>
                                        </Rectangle>
                                        <Rectangle Margin="1" x:Name="Highlight" IsHitTestVisible="false" Opacity="0" RadiusX="1" RadiusY="1" Stroke="#FF45D6FA" StrokeThickness="1"/>
                                        <Rectangle x:Name="FocusVisualElement" IsHitTestVisible="false" Visibility="Collapsed" RadiusX="1" RadiusY="1" Stroke="#FF45D6FA" StrokeThickness="1"/>
                                        <Path Height="Auto" HorizontalAlignment="Stretch" Margin="4,3,4,3" VerticalAlignment="Stretch" Width="Auto" Fill="#FF333333" Stretch="Uniform" Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z "/>
                                    </Grid>
                                </ControlTemplate>
                            </Grid.Resources>
                            <vsm:VisualStateManager.VisualStateGroups>
                                <vsm:VisualStateGroup x:Name="CommonStates">
                                    <vsm:VisualStateGroup.Transitions>
                                        <vsm:VisualTransition GeneratedDuration="0"/>
                                    </vsm:VisualStateGroup.Transitions>
                                    <vsm:VisualState x:Name="Normal"/>
                                    <vsm:VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)" To="1"/>
                                        </Storyboard>
                                    </vsm:VisualState>
                                </vsm:VisualStateGroup>
                                <vsm:VisualStateGroup x:Name="FocusStates">
                                    <vsm:VisualState x:Name="Focused">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                    <vsm:VisualState x:Name="Unfocused"/>
                                </vsm:VisualStateGroup>
                            </vsm:VisualStateManager.VisualStateGroups>
                            <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition/>
                                        <RowDefinition Height="10"/>
                                    </Grid.RowDefinitions>
                                    <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" Grid.ColumnSpan="2"/>
                                    <RepeatButton x:Name="IncreaseButton" IsTabStop="False" Template="{StaticResource IncreaseButtonTemplate}" Grid.Column="0" Grid.Row="1" ClickMode="Press"/>
                                    <RepeatButton x:Name="DecreaseButton" IsTabStop="False" Template="{StaticResource DecreaseButtonTemplate}" Grid.Column="1" Grid.Row="1" ClickMode="Press"/>
                                </Grid>
                            </Border>
                            <Border x:Name="DisabledVisualElement" IsHitTestVisible="false" Opacity="0" Background="#A5FFFFFF" CornerRadius="3"/>
                            <Border x:Name="FocusVisualElement" IsHitTestVisible="false" Visibility="Collapsed" BorderBrush="#FF45D6FA" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="1,1,1,1"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

    </UserControl.Resources>
    <StackPanel>
        <!-- Content -->
        <ContentControl Content="Default Template" Style="{StaticResource Header}" />
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="50"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="200"/>
                <ColumnDefinition Width="200"/>
                <ColumnDefinition Width="200"/>
            </Grid.ColumnDefinitions>

            <TextBlock Grid.Row="0" Grid.Column="0" Style="{StaticResource Description}" Text="No content"  FontWeight="Bold"/>
            <inputToolkit:ButtonSpinner Grid.Row="1" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10"/>
            <TextBlock Grid.Row="0" Grid.Column="1" Style="{StaticResource Description}" Text="Content Attribute"/>
            <inputToolkit:ButtonSpinner Grid.Row="1" Grid.Column="1" Margin="10"
                                 Content="Content Attribute" 
                                 HorizontalAlignment="Center" VerticalAlignment="Center"/>
            <TextBlock Grid.Row="0" Grid.Column="2" Style="{StaticResource Description}" Text="Content Element"/>
            <inputToolkit:ButtonSpinner Grid.Row="1" Grid.Column="2" Margin="10"
                                 HorizontalAlignment="Center" VerticalAlignment="Center" 
                                 HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
                <Button Content="Content Element" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
            </inputToolkit:ButtonSpinner>
        </Grid>

        <!-- Horizontal Template -->
        <ContentControl Content="Horizontal Template" Style="{StaticResource Header}" />
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="50" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="200"/>
                <ColumnDefinition Width="200"/>
                <ColumnDefinition Width="200"/>
            </Grid.ColumnDefinitions>

            <TextBlock Grid.Row="0" Grid.Column="0" Style="{StaticResource Description}" Text="No content"  FontWeight="Bold"/>
            <inputToolkit:ButtonSpinner Style="{StaticResource ButtonSpinnerHorizontalStyle}" Grid.Row="1" Grid.Column="0" Margin="10" 
                                 HorizontalAlignment="Center" VerticalAlignment="Center"/>
            <TextBlock Grid.Row="0" Grid.Column="1" Style="{StaticResource Description}" Text="Content Attribute"/>
            <inputToolkit:ButtonSpinner Style="{StaticResource ButtonSpinnerHorizontalStyle}" Grid.Row="1" Grid.Column="1" Margin="10" 
                                 Content="Content Attribute" 
                                 HorizontalAlignment="Center" VerticalAlignment="Center"/>
            <TextBlock Grid.Row="0" Grid.Column="2" Style="{StaticResource Description}" Text="Content Element"/>
            <inputToolkit:ButtonSpinner Style="{StaticResource ButtonSpinnerHorizontalStyle}" Grid.Row="1" Grid.Column="2" 
                                 HorizontalAlignment="Center" VerticalAlignment="Center" 
                                 HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
                <Button Content="Content Element" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
            </inputToolkit:ButtonSpinner>
        </Grid>

        <!-- Vertical Template -->
        <ContentControl Content="Vertical Template" Style="{StaticResource Header}" />
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="100" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="200" />
                <ColumnDefinition Width="200" />
                <ColumnDefinition Width="200" />
            </Grid.ColumnDefinitions>

            <TextBlock Grid.Row="0" Grid.Column="0" Style="{StaticResource Description}" Text="No content"  FontWeight="Bold"/>
            <inputToolkit:ButtonSpinner Style="{StaticResource ButtonSpinnerVerticalStyle}" Grid.Row="1" Grid.Column="0" Margin="10"
                                 HorizontalAlignment="Center" VerticalAlignment="Center"/>
            <TextBlock Grid.Row="0" Grid.Column="1" Style="{StaticResource Description}" Text="Content Attribute"/>
            <inputToolkit:ButtonSpinner Style="{StaticResource ButtonSpinnerVerticalStyle}" Grid.Row="1" Grid.Column="1" Margin="10"
                                 Content="Content Attribute" 
                                 HorizontalAlignment="Center" VerticalAlignment="Center"/>
            <TextBlock Grid.Row="0" Grid.Column="2" Style="{StaticResource Description}" Text="Content Element"/>
            <inputToolkit:ButtonSpinner Style="{StaticResource ButtonSpinnerVerticalStyle}" Grid.Row="1" Grid.Column="2" Margin="10"
                                 HorizontalAlignment="Center" VerticalAlignment="Center" 
                                 HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
                <Button Content="Content Element" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
            </inputToolkit:ButtonSpinner>
        </Grid>

        <!-- Other Template -->
        <ContentControl Content="Other Templates" Style="{StaticResource Header}" />
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="50" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="200" />
                <ColumnDefinition Width="200" />
            </Grid.ColumnDefinitions>

            <TextBlock Grid.Row="0" Grid.Column="0" Style="{StaticResource Description}" Text="Content on Right"/>
            <inputToolkit:ButtonSpinner Style="{StaticResource ButtonSpinnerLeftyStyle}" Grid.Row="1" Grid.Column="0" Margin="10"
                                 HorizontalAlignment="Center" VerticalAlignment="Center" 
                                 HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
                <Button Content="Content On Right"/>
            </inputToolkit:ButtonSpinner>
            <TextBlock Grid.Row="0" Grid.Column="1" Style="{StaticResource Description}" Text="Content on Top"/>
            <inputToolkit:ButtonSpinner Style="{StaticResource ButtonSpinnerTopStyle}" Grid.Row="1" Grid.Column="1" Margin="10"
                                 HorizontalAlignment="Center" VerticalAlignment="Center" 
                                 HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
                <Button Content="Content On Top"/>
            </inputToolkit:ButtonSpinner>
        </Grid>

        <!-- Interactive Usage -->
        <ContentControl Content="Interactive Usage" Style="{StaticResource Header}" />
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="150"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="75" />
                <ColumnDefinition Width="75" />
                <ColumnDefinition Width="250" />
            </Grid.ColumnDefinitions>
            <inputToolkit:ButtonSpinner x:Name="spinner1" BorderThickness="5" BorderBrush="Black" Style="{StaticResource ButtonSpinnerVerticalStyle}" Margin="5" Grid.Column="0"/>
            <inputToolkit:ButtonSpinner x:Name="spinner2" BorderThickness="5" BorderBrush="Red" Style="{StaticResource ButtonSpinnerHorizontalStyle}" Margin="5" Grid.Column="1"/>
            <ListBox x:Name="display" Grid.Column="2"/>
        </Grid>
        <src:SourceViewer xmlns:src="clr-namespace:System.Windows.Controls.Samples;assembly=System.Windows.Controls.Samples.Common" xmlns:sys="clr-namespace:System;assembly=mscorlib">
  <src:SourceFile Path="ButtonSpinnerSample.xaml">
    <src:SourceFile.Source>
      <sys:String>&lt;!--
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.
--&gt;

&lt;UserControl x:Class="System.Windows.Controls.Samples.ButtonSpinnerSample"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:inputToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"
xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
    
    &gt;
    &lt;UserControl.Resources&gt;
        &lt;Style x:Key="ButtonSpinnerHorizontalStyle" TargetType="inputToolkit:ButtonSpinner"&gt;
            &lt;Setter Property="HorizontalContentAlignment" Value="Center"/&gt;
            &lt;Setter Property="VerticalContentAlignment" Value="Center"/&gt;
            &lt;Setter Property="Template"&gt;
                &lt;Setter.Value&gt;
                    &lt;ControlTemplate TargetType="inputToolkit:ButtonSpinner"&gt;
                        &lt;Grid&gt;
                            &lt;Grid.Resources&gt;
                                &lt;ControlTemplate x:Key="IncreaseButtonTemplate" TargetType="RepeatButton"&gt;
                                    &lt;Grid x:Name="Root"&gt;
                                        &lt;vsm:VisualStateManager.VisualStateGroups&gt;
                                            &lt;vsm:VisualStateGroup x:Name="CommonStates"&gt;
                                                &lt;vsm:VisualStateGroup.Transitions&gt;
                                                    &lt;vsm:VisualTransition GeneratedDuration="0"/&gt;
                                                    &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/&gt;
                                                    &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/&gt;
                                                &lt;/vsm:VisualStateGroup.Transitions&gt;
                                                &lt;vsm:VisualState x:Name="Normal"/&gt;
                                                &lt;vsm:VisualState x:Name="MouseOver"&gt;
                                                    &lt;Storyboard&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#FF448DCA"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#F2FFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#CCFFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#7FFFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                    &lt;/Storyboard&gt;
                                                &lt;/vsm:VisualState&gt;
                                                &lt;vsm:VisualState x:Name="Pressed"&gt;
                                                    &lt;Storyboard&gt;
                                                        &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)"&gt;
                                                            &lt;SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/&gt;
                                                        &lt;/DoubleAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#FF448DCA"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#F4FFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#EAFFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#C6FFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#6BFFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                    &lt;/Storyboard&gt;
                                                &lt;/vsm:VisualState&gt;
                                            &lt;/vsm:VisualStateGroup&gt;
                                            &lt;vsm:VisualStateGroup x:Name="FocusStates"&gt;
                                                &lt;vsm:VisualState x:Name="Focused"&gt;
                                                    &lt;Storyboard&gt;
                                                        &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility"&gt;
                                                            &lt;DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/&gt;
                                                        &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;/Storyboard&gt;
                                                &lt;/vsm:VisualState&gt;
                                                &lt;vsm:VisualState x:Name="Unfocused"/&gt;
                                            &lt;/vsm:VisualStateGroup&gt;
                                        &lt;/vsm:VisualStateManager.VisualStateGroups&gt;
                                        &lt;Rectangle x:Name="Background" RadiusX="2" RadiusY="2" Fill="{TemplateBinding Background}" StrokeThickness="1"&gt;
                                            &lt;Rectangle.Stroke&gt;
                                                &lt;LinearGradientBrush EndPoint=".5,1" StartPoint=".5,0"&gt;
                                                    &lt;GradientStop Color="#FFAEB7BF" Offset="0"/&gt;
                                                    &lt;GradientStop Color="#FF919EA7" Offset="0.35"/&gt;
                                                    &lt;GradientStop Color="#FF7A8A99" Offset="0.35"/&gt;
                                                    &lt;GradientStop Color="#FF647480" Offset="1"/&gt;
                                                &lt;/LinearGradientBrush&gt;
                                            &lt;/Rectangle.Stroke&gt;
                                        &lt;/Rectangle&gt;
                                        &lt;Rectangle Margin="1" x:Name="BackgroundGradient" RadiusX="1" RadiusY="1" Stroke="#FFFFFFFF" StrokeThickness="1"&gt;
                                            &lt;Rectangle.Fill&gt;
                                                &lt;LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0"&gt;
                                                    &lt;GradientStop Color="#FFFFFFFF" Offset="0"/&gt;
                                                    &lt;GradientStop Color="#F9FFFFFF" Offset="0.375"/&gt;
                                                    &lt;GradientStop Color="#E5FFFFFF" Offset="0.625"/&gt;
                                                    &lt;GradientStop Color="#C6FFFFFF" Offset="1"/&gt;
                                                &lt;/LinearGradientBrush&gt;
                                            &lt;/Rectangle.Fill&gt;
                                        &lt;/Rectangle&gt;
                                        &lt;Rectangle Margin="1" x:Name="Highlight" IsHitTestVisible="false" Opacity="0" RadiusX="1" RadiusY="1" Stroke="#FF45D6FA" StrokeThickness="1"/&gt;
                                        &lt;Rectangle x:Name="FocusVisualElement" IsHitTestVisible="false" Visibility="Collapsed" RadiusX="1" RadiusY="1" Stroke="#FF45D6FA" StrokeThickness="1"/&gt;
                                        &lt;Path HorizontalAlignment="Stretch" Margin="4,3,4,3" VerticalAlignment="Stretch" Fill="#FF333333" Stretch="Uniform" Data="F1 M 541.537,173.589L 531.107,173.589L 536.322,167.49L 541.537,173.589 Z "/&gt;
                                    &lt;/Grid&gt;
                                &lt;/ControlTemplate&gt;
                                &lt;ControlTemplate x:Key="DecreaseButtonTemplate" TargetType="RepeatButton"&gt;
                                    &lt;Grid x:Name="Root"&gt;
                                        &lt;vsm:VisualStateManager.VisualStateGroups&gt;
                                            &lt;vsm:VisualStateGroup x:Name="CommonStates"&gt;
                                                &lt;vsm:VisualStateGroup.Transitions&gt;
                                                    &lt;vsm:VisualTransition GeneratedDuration="0"/&gt;
                                                    &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/&gt;
                                                    &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/&gt;
                                                &lt;/vsm:VisualStateGroup.Transitions&gt;
                                                &lt;vsm:VisualState x:Name="Normal"/&gt;
                                                &lt;vsm:VisualState x:Name="MouseOver"&gt;
                                                    &lt;Storyboard&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#FF448DCA"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#F2FFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#CCFFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#7FFFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                    &lt;/Storyboard&gt;
                                                &lt;/vsm:VisualState&gt;
                                                &lt;vsm:VisualState x:Name="Pressed"&gt;
                                                    &lt;Storyboard&gt;
                                                        &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)"&gt;
                                                            &lt;SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/&gt;
                                                        &lt;/DoubleAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#FF448DCA"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#F4FFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#EAFFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#C6FFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#6BFFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                    &lt;/Storyboard&gt;
                                                &lt;/vsm:VisualState&gt;
                                            &lt;/vsm:VisualStateGroup&gt;
                                            &lt;vsm:VisualStateGroup x:Name="FocusStates"&gt;
                                                &lt;vsm:VisualState x:Name="Focused"&gt;
                                                    &lt;Storyboard&gt;
                                                        &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility"&gt;
                                                            &lt;DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/&gt;
                                                        &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;/Storyboard&gt;
                                                &lt;/vsm:VisualState&gt;
                                                &lt;vsm:VisualState x:Name="Unfocused"/&gt;
                                            &lt;/vsm:VisualStateGroup&gt;
                                        &lt;/vsm:VisualStateManager.VisualStateGroups&gt;
                                        &lt;Rectangle x:Name="Background" RadiusX="2" RadiusY="2" Fill="{TemplateBinding Background}" StrokeThickness="1"&gt;
                                            &lt;Rectangle.Stroke&gt;
                                                &lt;LinearGradientBrush EndPoint=".5,1" StartPoint=".5,0"&gt;
                                                    &lt;GradientStop Color="#FFAEB7BF" Offset="0"/&gt;
                                                    &lt;GradientStop Color="#FF919EA7" Offset="0.35"/&gt;
                                                    &lt;GradientStop Color="#FF7A8A99" Offset="0.35"/&gt;
                                                    &lt;GradientStop Color="#FF647480" Offset="1"/&gt;
                                                &lt;/LinearGradientBrush&gt;
                                            &lt;/Rectangle.Stroke&gt;
                                        &lt;/Rectangle&gt;
                                        &lt;Rectangle Margin="1" x:Name="BackgroundGradient" RadiusX="1" RadiusY="1" Stroke="#FFFFFFFF" StrokeThickness="1"&gt;
                                            &lt;Rectangle.Fill&gt;
                                                &lt;LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0"&gt;
                                                    &lt;GradientStop Color="#FFFFFFFF" Offset="0"/&gt;
                                                    &lt;GradientStop Color="#F9FFFFFF" Offset="0.375"/&gt;
                                                    &lt;GradientStop Color="#E5FFFFFF" Offset="0.625"/&gt;
                                                    &lt;GradientStop Color="#C6FFFFFF" Offset="1"/&gt;
                                                &lt;/LinearGradientBrush&gt;
                                            &lt;/Rectangle.Fill&gt;
                                        &lt;/Rectangle&gt;
                                        &lt;Rectangle Margin="1" x:Name="Highlight" IsHitTestVisible="false" Opacity="0" RadiusX="1" RadiusY="1" Stroke="#FF45D6FA" StrokeThickness="1"/&gt;
                                        &lt;Rectangle x:Name="FocusVisualElement" IsHitTestVisible="false" Visibility="Collapsed" RadiusX="1" RadiusY="1" Stroke="#FF45D6FA" StrokeThickness="1"/&gt;
                                        &lt;Path Height="Auto" HorizontalAlignment="Stretch" Margin="4,3,4,3" VerticalAlignment="Stretch" Width="Auto" Fill="#FF333333" Stretch="Uniform" Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z "/&gt;
                                    &lt;/Grid&gt;
                                &lt;/ControlTemplate&gt;
                            &lt;/Grid.Resources&gt;
                            &lt;vsm:VisualStateManager.VisualStateGroups&gt;
                                &lt;vsm:VisualStateGroup x:Name="CommonStates"&gt;
                                    &lt;vsm:VisualStateGroup.Transitions&gt;
                                        &lt;vsm:VisualTransition GeneratedDuration="0"/&gt;
                                    &lt;/vsm:VisualStateGroup.Transitions&gt;
                                    &lt;vsm:VisualState x:Name="Normal"/&gt;
                                    &lt;vsm:VisualState x:Name="Disabled"&gt;
                                        &lt;Storyboard&gt;
                                            &lt;DoubleAnimation Duration="0" Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)" To="1"/&gt;
                                        &lt;/Storyboard&gt;
                                    &lt;/vsm:VisualState&gt;
                                &lt;/vsm:VisualStateGroup&gt;
                                &lt;vsm:VisualStateGroup x:Name="FocusStates"&gt;
                                    &lt;vsm:VisualState x:Name="Focused"&gt;
                                        &lt;Storyboard&gt;
                                            &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility"&gt;
                                                &lt;DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/&gt;
                                            &lt;/ObjectAnimationUsingKeyFrames&gt;
                                        &lt;/Storyboard&gt;
                                    &lt;/vsm:VisualState&gt;
                                    &lt;vsm:VisualState x:Name="Unfocused"/&gt;
                                &lt;/vsm:VisualStateGroup&gt;
                            &lt;/vsm:VisualStateManager.VisualStateGroups&gt;
                            &lt;Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}"&gt;
                                &lt;Grid&gt;
                                    &lt;Grid.ColumnDefinitions&gt;
                                        &lt;ColumnDefinition Width="*"/&gt;
                                        &lt;ColumnDefinition Width="Auto"/&gt;
                                        &lt;ColumnDefinition Width="*"/&gt;
                                    &lt;/Grid.ColumnDefinitions&gt;
                                    &lt;ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" Grid.Column="1"/&gt;
                                    &lt;RepeatButton IsTabStop="False" Template="{StaticResource IncreaseButtonTemplate}" x:Name="IncreaseButton" ClickMode="Press"/&gt;
                                    &lt;RepeatButton IsTabStop="False" Template="{StaticResource DecreaseButtonTemplate}" x:Name="DecreaseButton" ClickMode="Press" Grid.Column="2"/&gt;
                                &lt;/Grid&gt;
                            &lt;/Border&gt;
                            &lt;Border x:Name="DisabledVisualElement" IsHitTestVisible="false" Opacity="0" Background="#A5FFFFFF" CornerRadius="3"/&gt;
                            &lt;Border x:Name="FocusVisualElement" IsHitTestVisible="false" Visibility="Collapsed" BorderBrush="#FF45D6FA" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="1,1,1,1"/&gt;
                        &lt;/Grid&gt;
                    &lt;/ControlTemplate&gt;
                &lt;/Setter.Value&gt;
            &lt;/Setter&gt;
        &lt;/Style&gt;

        &lt;Style x:Key="ButtonSpinnerVerticalStyle" TargetType="inputToolkit:ButtonSpinner"&gt;
            &lt;Setter Property="HorizontalContentAlignment" Value="Center"/&gt;
            &lt;Setter Property="VerticalContentAlignment" Value="Center"/&gt;
            &lt;Setter Property="Template"&gt;
                &lt;Setter.Value&gt;
                    &lt;ControlTemplate TargetType="inputToolkit:ButtonSpinner"&gt;
                        &lt;Grid&gt;
                            &lt;Grid.Resources&gt;
                                &lt;ControlTemplate x:Key="IncreaseButtonTemplate" TargetType="RepeatButton"&gt;
                                    &lt;Grid x:Name="Root"&gt;
                                        &lt;vsm:VisualStateManager.VisualStateGroups&gt;
                                            &lt;vsm:VisualStateGroup x:Name="CommonStates"&gt;
                                                &lt;vsm:VisualStateGroup.Transitions&gt;
                                                    &lt;vsm:VisualTransition GeneratedDuration="0"/&gt;
                                                    &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/&gt;
                                                    &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/&gt;
                                                &lt;/vsm:VisualStateGroup.Transitions&gt;
                                                &lt;vsm:VisualState x:Name="Normal"/&gt;
                                                &lt;vsm:VisualState x:Name="MouseOver"&gt;
                                                    &lt;Storyboard&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#FF448DCA"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#F2FFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#CCFFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#7FFFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                    &lt;/Storyboard&gt;
                                                &lt;/vsm:VisualState&gt;
                                                &lt;vsm:VisualState x:Name="Pressed"&gt;
                                                    &lt;Storyboard&gt;
                                                        &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)"&gt;
                                                            &lt;SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/&gt;
                                                        &lt;/DoubleAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#FF448DCA"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#F4FFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#EAFFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#C6FFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#6BFFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                    &lt;/Storyboard&gt;
                                                &lt;/vsm:VisualState&gt;
                                            &lt;/vsm:VisualStateGroup&gt;
                                            &lt;vsm:VisualStateGroup x:Name="FocusStates"&gt;
                                                &lt;vsm:VisualState x:Name="Focused"&gt;
                                                    &lt;Storyboard&gt;
                                                        &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility"&gt;
                                                            &lt;DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/&gt;
                                                        &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;/Storyboard&gt;
                                                &lt;/vsm:VisualState&gt;
                                                &lt;vsm:VisualState x:Name="Unfocused"/&gt;
                                            &lt;/vsm:VisualStateGroup&gt;
                                        &lt;/vsm:VisualStateManager.VisualStateGroups&gt;
                                        &lt;Rectangle x:Name="Background" RadiusX="2" RadiusY="2" Fill="{TemplateBinding Background}" StrokeThickness="1"&gt;
                                            &lt;Rectangle.Stroke&gt;
                                                &lt;LinearGradientBrush EndPoint=".5,1" StartPoint=".5,0"&gt;
                                                    &lt;GradientStop Color="#FFAEB7BF" Offset="0"/&gt;
                                                    &lt;GradientStop Color="#FF919EA7" Offset="0.35"/&gt;
                                                    &lt;GradientStop Color="#FF7A8A99" Offset="0.35"/&gt;
                                                    &lt;GradientStop Color="#FF647480" Offset="1"/&gt;
                                                &lt;/LinearGradientBrush&gt;
                                            &lt;/Rectangle.Stroke&gt;
                                        &lt;/Rectangle&gt;
                                        &lt;Rectangle Margin="1" x:Name="BackgroundGradient" RadiusX="1" RadiusY="1" Stroke="#FFFFFFFF" StrokeThickness="1"&gt;
                                            &lt;Rectangle.Fill&gt;
                                                &lt;LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0"&gt;
                                                    &lt;GradientStop Color="#FFFFFFFF" Offset="0"/&gt;
                                                    &lt;GradientStop Color="#F9FFFFFF" Offset="0.375"/&gt;
                                                    &lt;GradientStop Color="#E5FFFFFF" Offset="0.625"/&gt;
                                                    &lt;GradientStop Color="#C6FFFFFF" Offset="1"/&gt;
                                                &lt;/LinearGradientBrush&gt;
                                            &lt;/Rectangle.Fill&gt;
                                        &lt;/Rectangle&gt;
                                        &lt;Rectangle Margin="1" x:Name="Highlight" IsHitTestVisible="false" Opacity="0" RadiusX="1" RadiusY="1" Stroke="#FF45D6FA" StrokeThickness="1"/&gt;
                                        &lt;Rectangle x:Name="FocusVisualElement" IsHitTestVisible="false" Visibility="Collapsed" RadiusX="1" RadiusY="1" Stroke="#FF45D6FA" StrokeThickness="1"/&gt;
                                        &lt;Path HorizontalAlignment="Stretch" Margin="4,3,4,3" VerticalAlignment="Stretch" Fill="#FF333333" Stretch="Uniform" Data="F1 M 541.537,173.589L 531.107,173.589L 536.322,167.49L 541.537,173.589 Z "/&gt;
                                    &lt;/Grid&gt;
                                &lt;/ControlTemplate&gt;
                                &lt;ControlTemplate x:Key="DecreaseButtonTemplate" TargetType="RepeatButton"&gt;
                                    &lt;Grid x:Name="Root"&gt;
                                        &lt;vsm:VisualStateManager.VisualStateGroups&gt;
                                            &lt;vsm:VisualStateGroup x:Name="CommonStates"&gt;
                                                &lt;vsm:VisualStateGroup.Transitions&gt;
                                                    &lt;vsm:VisualTransition GeneratedDuration="0"/&gt;
                                                    &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/&gt;
                                                    &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/&gt;
                                                &lt;/vsm:VisualStateGroup.Transitions&gt;
                                                &lt;vsm:VisualState x:Name="Normal"/&gt;
                                                &lt;vsm:VisualState x:Name="MouseOver"&gt;
                                                    &lt;Storyboard&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#FF448DCA"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#F2FFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#CCFFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#7FFFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                    &lt;/Storyboard&gt;
                                                &lt;/vsm:VisualState&gt;
                                                &lt;vsm:VisualState x:Name="Pressed"&gt;
                                                    &lt;Storyboard&gt;
                                                        &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)"&gt;
                                                            &lt;SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/&gt;
                                                        &lt;/DoubleAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#FF448DCA"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#F4FFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#EAFFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#C6FFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#6BFFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                    &lt;/Storyboard&gt;
                                                &lt;/vsm:VisualState&gt;
                                            &lt;/vsm:VisualStateGroup&gt;
                                            &lt;vsm:VisualStateGroup x:Name="FocusStates"&gt;
                                                &lt;vsm:VisualState x:Name="Focused"&gt;
                                                    &lt;Storyboard&gt;
                                                        &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility"&gt;
                                                            &lt;DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/&gt;
                                                        &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;/Storyboard&gt;
                                                &lt;/vsm:VisualState&gt;
                                                &lt;vsm:VisualState x:Name="Unfocused"/&gt;
                                            &lt;/vsm:VisualStateGroup&gt;
                                        &lt;/vsm:VisualStateManager.VisualStateGroups&gt;
                                        &lt;Rectangle x:Name="Background" RadiusX="2" RadiusY="2" Fill="{TemplateBinding Background}" StrokeThickness="1"&gt;
                                            &lt;Rectangle.Stroke&gt;
                                                &lt;LinearGradientBrush EndPoint=".5,1" StartPoint=".5,0"&gt;
                                                    &lt;GradientStop Color="#FFAEB7BF" Offset="0"/&gt;
                                                    &lt;GradientStop Color="#FF919EA7" Offset="0.35"/&gt;
                                                    &lt;GradientStop Color="#FF7A8A99" Offset="0.35"/&gt;
                                                    &lt;GradientStop Color="#FF647480" Offset="1"/&gt;
                                                &lt;/LinearGradientBrush&gt;
                                            &lt;/Rectangle.Stroke&gt;
                                        &lt;/Rectangle&gt;
                                        &lt;Rectangle Margin="1" x:Name="BackgroundGradient" RadiusX="1" RadiusY="1" Stroke="#FFFFFFFF" StrokeThickness="1"&gt;
                                            &lt;Rectangle.Fill&gt;
                                                &lt;LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0"&gt;
                                                    &lt;GradientStop Color="#FFFFFFFF" Offset="0"/&gt;
                                                    &lt;GradientStop Color="#F9FFFFFF" Offset="0.375"/&gt;
                                                    &lt;GradientStop Color="#E5FFFFFF" Offset="0.625"/&gt;
                                                    &lt;GradientStop Color="#C6FFFFFF" Offset="1"/&gt;
                                                &lt;/LinearGradientBrush&gt;
                                            &lt;/Rectangle.Fill&gt;
                                        &lt;/Rectangle&gt;
                                        &lt;Rectangle Margin="1" x:Name="Highlight" IsHitTestVisible="false" Opacity="0" RadiusX="1" RadiusY="1" Stroke="#FF45D6FA" StrokeThickness="1"/&gt;
                                        &lt;Rectangle x:Name="FocusVisualElement" IsHitTestVisible="false" Visibility="Collapsed" RadiusX="1" RadiusY="1" Stroke="#FF45D6FA" StrokeThickness="1"/&gt;
                                        &lt;Path Height="Auto" HorizontalAlignment="Stretch" Margin="4,3,4,3" VerticalAlignment="Stretch" Width="Auto" Fill="#FF333333" Stretch="Uniform" Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z "/&gt;
                                    &lt;/Grid&gt;
                                &lt;/ControlTemplate&gt;
                            &lt;/Grid.Resources&gt;
                            &lt;vsm:VisualStateManager.VisualStateGroups&gt;
                                &lt;vsm:VisualStateGroup x:Name="CommonStates"&gt;
                                    &lt;vsm:VisualStateGroup.Transitions&gt;
                                        &lt;vsm:VisualTransition GeneratedDuration="0"/&gt;
                                    &lt;/vsm:VisualStateGroup.Transitions&gt;
                                    &lt;vsm:VisualState x:Name="Normal"/&gt;
                                    &lt;vsm:VisualState x:Name="Disabled"&gt;
                                        &lt;Storyboard&gt;
                                            &lt;DoubleAnimation Duration="0" Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)" To="1"/&gt;
                                        &lt;/Storyboard&gt;
                                    &lt;/vsm:VisualState&gt;
                                &lt;/vsm:VisualStateGroup&gt;
                                &lt;vsm:VisualStateGroup x:Name="FocusStates"&gt;
                                    &lt;vsm:VisualState x:Name="Focused"&gt;
                                        &lt;Storyboard&gt;
                                            &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility"&gt;
                                                &lt;DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/&gt;
                                            &lt;/ObjectAnimationUsingKeyFrames&gt;
                                        &lt;/Storyboard&gt;
                                    &lt;/vsm:VisualState&gt;
                                    &lt;vsm:VisualState x:Name="Unfocused"/&gt;
                                &lt;/vsm:VisualStateGroup&gt;
                            &lt;/vsm:VisualStateManager.VisualStateGroups&gt;
                            &lt;Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}"&gt;
                                &lt;Grid&gt;
                                    &lt;Grid.RowDefinitions&gt;
                                        &lt;RowDefinition Height="*"/&gt;
                                        &lt;RowDefinition Height="Auto"/&gt;
                                        &lt;RowDefinition Height="*"/&gt;
                                    &lt;/Grid.RowDefinitions&gt;
                                    &lt;ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" Grid.Row="1"/&gt;
                                    &lt;RepeatButton IsTabStop="False" Template="{StaticResource IncreaseButtonTemplate}" x:Name="IncreaseButton" ClickMode="Press"/&gt;
                                    &lt;RepeatButton IsTabStop="False" Template="{StaticResource DecreaseButtonTemplate}" x:Name="DecreaseButton" ClickMode="Press" Grid.Row="2"/&gt;
                                &lt;/Grid&gt;
                            &lt;/Border&gt;
                            &lt;Border x:Name="DisabledVisualElement" IsHitTestVisible="false" Opacity="0" Background="#A5FFFFFF" CornerRadius="3"/&gt;
                            &lt;Border x:Name="FocusVisualElement" IsHitTestVisible="false" Visibility="Collapsed" BorderBrush="#FF45D6FA" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="1,1,1,1"/&gt;
                        &lt;/Grid&gt;
                    &lt;/ControlTemplate&gt;
                &lt;/Setter.Value&gt;
            &lt;/Setter&gt;
        &lt;/Style&gt;
        &lt;Style x:Key="ButtonSpinnerLeftyStyle" TargetType="inputToolkit:ButtonSpinner"&gt;
            &lt;Setter Property="HorizontalContentAlignment" Value="Center"/&gt;
            &lt;Setter Property="VerticalContentAlignment" Value="Center"/&gt;
            &lt;Setter Property="Template"&gt;
                &lt;Setter.Value&gt;
                    &lt;ControlTemplate TargetType="inputToolkit:ButtonSpinner"&gt;
                        &lt;Grid&gt;
                            &lt;Grid.Resources&gt;
                                &lt;ControlTemplate x:Key="IncreaseButtonTemplate" TargetType="RepeatButton"&gt;
                                    &lt;Grid x:Name="Root"&gt;
                                        &lt;vsm:VisualStateManager.VisualStateGroups&gt;
                                            &lt;vsm:VisualStateGroup x:Name="CommonStates"&gt;
                                                &lt;vsm:VisualStateGroup.Transitions&gt;
                                                    &lt;vsm:VisualTransition GeneratedDuration="0"/&gt;
                                                    &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/&gt;
                                                    &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/&gt;
                                                &lt;/vsm:VisualStateGroup.Transitions&gt;
                                                &lt;vsm:VisualState x:Name="Normal"/&gt;
                                                &lt;vsm:VisualState x:Name="MouseOver"&gt;
                                                    &lt;Storyboard&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#FF448DCA"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#F2FFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#CCFFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#7FFFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                    &lt;/Storyboard&gt;
                                                &lt;/vsm:VisualState&gt;
                                                &lt;vsm:VisualState x:Name="Pressed"&gt;
                                                    &lt;Storyboard&gt;
                                                        &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)"&gt;
                                                            &lt;SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/&gt;
                                                        &lt;/DoubleAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#FF448DCA"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#F4FFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#EAFFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#C6FFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#6BFFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                    &lt;/Storyboard&gt;
                                                &lt;/vsm:VisualState&gt;
                                            &lt;/vsm:VisualStateGroup&gt;
                                            &lt;vsm:VisualStateGroup x:Name="FocusStates"&gt;
                                                &lt;vsm:VisualState x:Name="Focused"&gt;
                                                    &lt;Storyboard&gt;
                                                        &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility"&gt;
                                                            &lt;DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/&gt;
                                                        &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;/Storyboard&gt;
                                                &lt;/vsm:VisualState&gt;
                                                &lt;vsm:VisualState x:Name="Unfocused"/&gt;
                                            &lt;/vsm:VisualStateGroup&gt;
                                        &lt;/vsm:VisualStateManager.VisualStateGroups&gt;
                                        &lt;Rectangle x:Name="Background" RadiusX="2" RadiusY="2" Fill="{TemplateBinding Background}" StrokeThickness="1"&gt;
                                            &lt;Rectangle.Stroke&gt;
                                                &lt;LinearGradientBrush EndPoint=".5,1" StartPoint=".5,0"&gt;
                                                    &lt;GradientStop Color="#FFAEB7BF" Offset="0"/&gt;
                                                    &lt;GradientStop Color="#FF919EA7" Offset="0.35"/&gt;
                                                    &lt;GradientStop Color="#FF7A8A99" Offset="0.35"/&gt;
                                                    &lt;GradientStop Color="#FF647480" Offset="1"/&gt;
                                                &lt;/LinearGradientBrush&gt;
                                            &lt;/Rectangle.Stroke&gt;
                                        &lt;/Rectangle&gt;
                                        &lt;Rectangle Margin="1" x:Name="BackgroundGradient" RadiusX="1" RadiusY="1" Stroke="#FFFFFFFF" StrokeThickness="1"&gt;
                                            &lt;Rectangle.Fill&gt;
                                                &lt;LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0"&gt;
                                                    &lt;GradientStop Color="#FFFFFFFF" Offset="0"/&gt;
                                                    &lt;GradientStop Color="#F9FFFFFF" Offset="0.375"/&gt;
                                                    &lt;GradientStop Color="#E5FFFFFF" Offset="0.625"/&gt;
                                                    &lt;GradientStop Color="#C6FFFFFF" Offset="1"/&gt;
                                                &lt;/LinearGradientBrush&gt;
                                            &lt;/Rectangle.Fill&gt;
                                        &lt;/Rectangle&gt;
                                        &lt;Rectangle Margin="1" x:Name="Highlight" IsHitTestVisible="false" Opacity="0" RadiusX="1" RadiusY="1" Stroke="#FF45D6FA" StrokeThickness="1"/&gt;
                                        &lt;Rectangle x:Name="FocusVisualElement" IsHitTestVisible="false" Visibility="Collapsed" RadiusX="1" RadiusY="1" Stroke="#FF45D6FA" StrokeThickness="1"/&gt;
                                        &lt;Path HorizontalAlignment="Stretch" Margin="4,3,4,3" VerticalAlignment="Stretch" Fill="#FF333333" Stretch="Uniform" Data="F1 M 541.537,173.589L 531.107,173.589L 536.322,167.49L 541.537,173.589 Z "/&gt;
                                    &lt;/Grid&gt;
                                &lt;/ControlTemplate&gt;
                                &lt;ControlTemplate x:Key="DecreaseButtonTemplate" TargetType="RepeatButton"&gt;
                                    &lt;Grid x:Name="Root"&gt;
                                        &lt;vsm:VisualStateManager.VisualStateGroups&gt;
                                            &lt;vsm:VisualStateGroup x:Name="CommonStates"&gt;
                                                &lt;vsm:VisualStateGroup.Transitions&gt;
                                                    &lt;vsm:VisualTransition GeneratedDuration="0"/&gt;
                                                    &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/&gt;
                                                    &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/&gt;
                                                &lt;/vsm:VisualStateGroup.Transitions&gt;
                                                &lt;vsm:VisualState x:Name="Normal"/&gt;
                                                &lt;vsm:VisualState x:Name="MouseOver"&gt;
                                                    &lt;Storyboard&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#FF448DCA"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#F2FFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#CCFFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#7FFFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                    &lt;/Storyboard&gt;
                                                &lt;/vsm:VisualState&gt;
                                                &lt;vsm:VisualState x:Name="Pressed"&gt;
                                                    &lt;Storyboard&gt;
                                                        &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)"&gt;
                                                            &lt;SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/&gt;
                                                        &lt;/DoubleAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#FF448DCA"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#F4FFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#EAFFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#C6FFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#6BFFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                    &lt;/Storyboard&gt;
                                                &lt;/vsm:VisualState&gt;
                                            &lt;/vsm:VisualStateGroup&gt;
                                            &lt;vsm:VisualStateGroup x:Name="FocusStates"&gt;
                                                &lt;vsm:VisualState x:Name="Focused"&gt;
                                                    &lt;Storyboard&gt;
                                                        &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility"&gt;
                                                            &lt;DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/&gt;
                                                        &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;/Storyboard&gt;
                                                &lt;/vsm:VisualState&gt;
                                                &lt;vsm:VisualState x:Name="Unfocused"/&gt;
                                            &lt;/vsm:VisualStateGroup&gt;
                                        &lt;/vsm:VisualStateManager.VisualStateGroups&gt;
                                        &lt;Rectangle x:Name="Background" RadiusX="2" RadiusY="2" Fill="{TemplateBinding Background}" StrokeThickness="1"&gt;
                                            &lt;Rectangle.Stroke&gt;
                                                &lt;LinearGradientBrush EndPoint=".5,1" StartPoint=".5,0"&gt;
                                                    &lt;GradientStop Color="#FFAEB7BF" Offset="0"/&gt;
                                                    &lt;GradientStop Color="#FF919EA7" Offset="0.35"/&gt;
                                                    &lt;GradientStop Color="#FF7A8A99" Offset="0.35"/&gt;
                                                    &lt;GradientStop Color="#FF647480" Offset="1"/&gt;
                                                &lt;/LinearGradientBrush&gt;
                                            &lt;/Rectangle.Stroke&gt;
                                        &lt;/Rectangle&gt;
                                        &lt;Rectangle Margin="1" x:Name="BackgroundGradient" RadiusX="1" RadiusY="1" Stroke="#FFFFFFFF" StrokeThickness="1"&gt;
                                            &lt;Rectangle.Fill&gt;
                                                &lt;LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0"&gt;
                                                    &lt;GradientStop Color="#FFFFFFFF" Offset="0"/&gt;
                                                    &lt;GradientStop Color="#F9FFFFFF" Offset="0.375"/&gt;
                                                    &lt;GradientStop Color="#E5FFFFFF" Offset="0.625"/&gt;
                                                    &lt;GradientStop Color="#C6FFFFFF" Offset="1"/&gt;
                                                &lt;/LinearGradientBrush&gt;
                                            &lt;/Rectangle.Fill&gt;
                                        &lt;/Rectangle&gt;
                                        &lt;Rectangle Margin="1" x:Name="Highlight" IsHitTestVisible="false" Opacity="0" RadiusX="1" RadiusY="1" Stroke="#FF45D6FA" StrokeThickness="1"/&gt;
                                        &lt;Rectangle x:Name="FocusVisualElement" IsHitTestVisible="false" Visibility="Collapsed" RadiusX="1" RadiusY="1" Stroke="#FF45D6FA" StrokeThickness="1"/&gt;
                                        &lt;Path Height="Auto" HorizontalAlignment="Stretch" Margin="4,3,4,3" VerticalAlignment="Stretch" Width="Auto" Fill="#FF333333" Stretch="Uniform" Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z "/&gt;
                                    &lt;/Grid&gt;
                                &lt;/ControlTemplate&gt;
                            &lt;/Grid.Resources&gt;
                            &lt;vsm:VisualStateManager.VisualStateGroups&gt;
                                &lt;vsm:VisualStateGroup x:Name="CommonStates"&gt;
                                    &lt;vsm:VisualStateGroup.Transitions&gt;
                                        &lt;vsm:VisualTransition GeneratedDuration="0"/&gt;
                                    &lt;/vsm:VisualStateGroup.Transitions&gt;
                                    &lt;vsm:VisualState x:Name="Normal"/&gt;
                                    &lt;vsm:VisualState x:Name="Disabled"&gt;
                                        &lt;Storyboard&gt;
                                            &lt;DoubleAnimation Duration="0" Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)" To="1"/&gt;
                                        &lt;/Storyboard&gt;
                                    &lt;/vsm:VisualState&gt;
                                &lt;/vsm:VisualStateGroup&gt;
                                &lt;vsm:VisualStateGroup x:Name="FocusStates"&gt;
                                    &lt;vsm:VisualState x:Name="Focused"&gt;
                                        &lt;Storyboard&gt;
                                            &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility"&gt;
                                                &lt;DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/&gt;
                                            &lt;/ObjectAnimationUsingKeyFrames&gt;
                                        &lt;/Storyboard&gt;
                                    &lt;/vsm:VisualState&gt;
                                    &lt;vsm:VisualState x:Name="Unfocused"/&gt;
                                &lt;/vsm:VisualStateGroup&gt;
                            &lt;/vsm:VisualStateManager.VisualStateGroups&gt;
                            &lt;Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}"&gt;
                                &lt;Grid&gt;
                                    &lt;Grid.ColumnDefinitions&gt;
                                        &lt;ColumnDefinition Width="15"/&gt;
                                        &lt;ColumnDefinition/&gt;
                                    &lt;/Grid.ColumnDefinitions&gt;
                                    &lt;Grid.RowDefinitions&gt;
                                        &lt;RowDefinition/&gt;
                                        &lt;RowDefinition/&gt;
                                    &lt;/Grid.RowDefinitions&gt;
                                    &lt;ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" Grid.Column="1" Grid.RowSpan="2"/&gt;
                                    &lt;RepeatButton x:Name="IncreaseButton" IsTabStop="False" Template="{StaticResource IncreaseButtonTemplate}" Grid.Column="0" Grid.Row="0" ClickMode="Press"/&gt;
                                    &lt;RepeatButton x:Name="DecreaseButton" IsTabStop="False" Template="{StaticResource DecreaseButtonTemplate}" Grid.Column="0" Grid.Row="1" ClickMode="Press"/&gt;
                                &lt;/Grid&gt;
                            &lt;/Border&gt;
                            &lt;Border x:Name="DisabledVisualElement" IsHitTestVisible="false" Opacity="0" Background="#A5FFFFFF" CornerRadius="3"/&gt;
                            &lt;Border x:Name="FocusVisualElement" IsHitTestVisible="false" Visibility="Collapsed" BorderBrush="#FF45D6FA" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="1,1,1,1"/&gt;
                        &lt;/Grid&gt;
                    &lt;/ControlTemplate&gt;
                &lt;/Setter.Value&gt;
            &lt;/Setter&gt;
        &lt;/Style&gt;
        &lt;Style x:Key="ButtonSpinnerTopStyle" TargetType="inputToolkit:ButtonSpinner"&gt;
            &lt;Setter Property="HorizontalContentAlignment" Value="Stretch"/&gt;
            &lt;Setter Property="VerticalContentAlignment" Value="Stretch"/&gt;
            &lt;Setter Property="Template"&gt;
                &lt;Setter.Value&gt;
                    &lt;ControlTemplate TargetType="inputToolkit:ButtonSpinner"&gt;
                        &lt;Grid&gt;
                            &lt;Grid.Resources&gt;
                                &lt;ControlTemplate x:Key="IncreaseButtonTemplate" TargetType="RepeatButton"&gt;
                                    &lt;Grid x:Name="Root"&gt;
                                        &lt;vsm:VisualStateManager.VisualStateGroups&gt;
                                            &lt;vsm:VisualStateGroup x:Name="CommonStates"&gt;
                                                &lt;vsm:VisualStateGroup.Transitions&gt;
                                                    &lt;vsm:VisualTransition GeneratedDuration="0"/&gt;
                                                    &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/&gt;
                                                    &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/&gt;
                                                &lt;/vsm:VisualStateGroup.Transitions&gt;
                                                &lt;vsm:VisualState x:Name="Normal"/&gt;
                                                &lt;vsm:VisualState x:Name="MouseOver"&gt;
                                                    &lt;Storyboard&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#FF448DCA"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#F2FFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#CCFFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#7FFFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                    &lt;/Storyboard&gt;
                                                &lt;/vsm:VisualState&gt;
                                                &lt;vsm:VisualState x:Name="Pressed"&gt;
                                                    &lt;Storyboard&gt;
                                                        &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)"&gt;
                                                            &lt;SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/&gt;
                                                        &lt;/DoubleAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#FF448DCA"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#F4FFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#EAFFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#C6FFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#6BFFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                    &lt;/Storyboard&gt;
                                                &lt;/vsm:VisualState&gt;
                                            &lt;/vsm:VisualStateGroup&gt;
                                            &lt;vsm:VisualStateGroup x:Name="FocusStates"&gt;
                                                &lt;vsm:VisualState x:Name="Focused"&gt;
                                                    &lt;Storyboard&gt;
                                                        &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility"&gt;
                                                            &lt;DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/&gt;
                                                        &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;/Storyboard&gt;
                                                &lt;/vsm:VisualState&gt;
                                                &lt;vsm:VisualState x:Name="Unfocused"/&gt;
                                            &lt;/vsm:VisualStateGroup&gt;
                                        &lt;/vsm:VisualStateManager.VisualStateGroups&gt;
                                        &lt;Rectangle x:Name="Background" RadiusX="2" RadiusY="2" Fill="{TemplateBinding Background}" StrokeThickness="1"&gt;
                                            &lt;Rectangle.Stroke&gt;
                                                &lt;LinearGradientBrush EndPoint=".5,1" StartPoint=".5,0"&gt;
                                                    &lt;GradientStop Color="#FFAEB7BF" Offset="0"/&gt;
                                                    &lt;GradientStop Color="#FF919EA7" Offset="0.35"/&gt;
                                                    &lt;GradientStop Color="#FF7A8A99" Offset="0.35"/&gt;
                                                    &lt;GradientStop Color="#FF647480" Offset="1"/&gt;
                                                &lt;/LinearGradientBrush&gt;
                                            &lt;/Rectangle.Stroke&gt;
                                        &lt;/Rectangle&gt;
                                        &lt;Rectangle Margin="1" x:Name="BackgroundGradient" RadiusX="1" RadiusY="1" Stroke="#FFFFFFFF" StrokeThickness="1"&gt;
                                            &lt;Rectangle.Fill&gt;
                                                &lt;LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0"&gt;
                                                    &lt;GradientStop Color="#FFFFFFFF" Offset="0"/&gt;
                                                    &lt;GradientStop Color="#F9FFFFFF" Offset="0.375"/&gt;
                                                    &lt;GradientStop Color="#E5FFFFFF" Offset="0.625"/&gt;
                                                    &lt;GradientStop Color="#C6FFFFFF" Offset="1"/&gt;
                                                &lt;/LinearGradientBrush&gt;
                                            &lt;/Rectangle.Fill&gt;
                                        &lt;/Rectangle&gt;
                                        &lt;Rectangle Margin="1" x:Name="Highlight" IsHitTestVisible="false" Opacity="0" RadiusX="1" RadiusY="1" Stroke="#FF45D6FA" StrokeThickness="1"/&gt;
                                        &lt;Rectangle x:Name="FocusVisualElement" IsHitTestVisible="false" Visibility="Collapsed" RadiusX="1" RadiusY="1" Stroke="#FF45D6FA" StrokeThickness="1"/&gt;
                                        &lt;Path HorizontalAlignment="Stretch" Margin="4,3,4,3" VerticalAlignment="Stretch" Fill="#FF333333" Stretch="Uniform" Data="F1 M 541.537,173.589L 531.107,173.589L 536.322,167.49L 541.537,173.589 Z "/&gt;
                                    &lt;/Grid&gt;
                                &lt;/ControlTemplate&gt;
                                &lt;ControlTemplate x:Key="DecreaseButtonTemplate" TargetType="RepeatButton"&gt;
                                    &lt;Grid x:Name="Root"&gt;
                                        &lt;vsm:VisualStateManager.VisualStateGroups&gt;
                                            &lt;vsm:VisualStateGroup x:Name="CommonStates"&gt;
                                                &lt;vsm:VisualStateGroup.Transitions&gt;
                                                    &lt;vsm:VisualTransition GeneratedDuration="0"/&gt;
                                                    &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/&gt;
                                                    &lt;vsm:VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/&gt;
                                                &lt;/vsm:VisualStateGroup.Transitions&gt;
                                                &lt;vsm:VisualState x:Name="Normal"/&gt;
                                                &lt;vsm:VisualState x:Name="MouseOver"&gt;
                                                    &lt;Storyboard&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#FF448DCA"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#F2FFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#CCFFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#7FFFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                    &lt;/Storyboard&gt;
                                                &lt;/vsm:VisualState&gt;
                                                &lt;vsm:VisualState x:Name="Pressed"&gt;
                                                    &lt;Storyboard&gt;
                                                        &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)"&gt;
                                                            &lt;SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/&gt;
                                                        &lt;/DoubleAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#FF448DCA"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#F4FFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#EAFFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#C6FFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                        &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)"&gt;
                                                            &lt;SplineColorKeyFrame KeyTime="00:00:00" Value="#6BFFFFFF"/&gt;
                                                        &lt;/ColorAnimationUsingKeyFrames&gt;
                                                    &lt;/Storyboard&gt;
                                                &lt;/vsm:VisualState&gt;
                                            &lt;/vsm:VisualStateGroup&gt;
                                            &lt;vsm:VisualStateGroup x:Name="FocusStates"&gt;
                                                &lt;vsm:VisualState x:Name="Focused"&gt;
                                                    &lt;Storyboard&gt;
                                                        &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility"&gt;
                                                            &lt;DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/&gt;
                                                        &lt;/ObjectAnimationUsingKeyFrames&gt;
                                                    &lt;/Storyboard&gt;
                                                &lt;/vsm:VisualState&gt;
                                                &lt;vsm:VisualState x:Name="Unfocused"/&gt;
                                            &lt;/vsm:VisualStateGroup&gt;
                                        &lt;/vsm:VisualStateManager.VisualStateGroups&gt;
                                        &lt;Rectangle x:Name="Background" RadiusX="2" RadiusY="2" Fill="{TemplateBinding Background}" StrokeThickness="1"&gt;
                                            &lt;Rectangle.Stroke&gt;
                                                &lt;LinearGradientBrush EndPoint=".5,1" StartPoint=".5,0"&gt;
                                                    &lt;GradientStop Color="#FFAEB7BF" Offset="0"/&gt;
                                                    &lt;GradientStop Color="#FF919EA7" Offset="0.35"/&gt;
                                                    &lt;GradientStop Color="#FF7A8A99" Offset="0.35"/&gt;
                                                    &lt;GradientStop Color="#FF647480" Offset="1"/&gt;
                                                &lt;/LinearGradientBrush&gt;
                                            &lt;/Rectangle.Stroke&gt;
                                        &lt;/Rectangle&gt;
                                        &lt;Rectangle Margin="1" x:Name="BackgroundGradient" RadiusX="1" RadiusY="1" Stroke="#FFFFFFFF" StrokeThickness="1"&gt;
                                            &lt;Rectangle.Fill&gt;
                                                &lt;LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0"&gt;
                                                    &lt;GradientStop Color="#FFFFFFFF" Offset="0"/&gt;
                                                    &lt;GradientStop Color="#F9FFFFFF" Offset="0.375"/&gt;
                                                    &lt;GradientStop Color="#E5FFFFFF" Offset="0.625"/&gt;
                                                    &lt;GradientStop Color="#C6FFFFFF" Offset="1"/&gt;
                                                &lt;/LinearGradientBrush&gt;
                                            &lt;/Rectangle.Fill&gt;
                                        &lt;/Rectangle&gt;
                                        &lt;Rectangle Margin="1" x:Name="Highlight" IsHitTestVisible="false" Opacity="0" RadiusX="1" RadiusY="1" Stroke="#FF45D6FA" StrokeThickness="1"/&gt;
                                        &lt;Rectangle x:Name="FocusVisualElement" IsHitTestVisible="false" Visibility="Collapsed" RadiusX="1" RadiusY="1" Stroke="#FF45D6FA" StrokeThickness="1"/&gt;
                                        &lt;Path Height="Auto" HorizontalAlignment="Stretch" Margin="4,3,4,3" VerticalAlignment="Stretch" Width="Auto" Fill="#FF333333" Stretch="Uniform" Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z "/&gt;
                                    &lt;/Grid&gt;
                                &lt;/ControlTemplate&gt;
                            &lt;/Grid.Resources&gt;
                            &lt;vsm:VisualStateManager.VisualStateGroups&gt;
                                &lt;vsm:VisualStateGroup x:Name="CommonStates"&gt;
                                    &lt;vsm:VisualStateGroup.Transitions&gt;
                                        &lt;vsm:VisualTransition GeneratedDuration="0"/&gt;
                                    &lt;/vsm:VisualStateGroup.Transitions&gt;
                                    &lt;vsm:VisualState x:Name="Normal"/&gt;
                                    &lt;vsm:VisualState x:Name="Disabled"&gt;
                                        &lt;Storyboard&gt;
                                            &lt;DoubleAnimation Duration="0" Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)" To="1"/&gt;
                                        &lt;/Storyboard&gt;
                                    &lt;/vsm:VisualState&gt;
                                &lt;/vsm:VisualStateGroup&gt;
                                &lt;vsm:VisualStateGroup x:Name="FocusStates"&gt;
                                    &lt;vsm:VisualState x:Name="Focused"&gt;
                                        &lt;Storyboard&gt;
                                            &lt;ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility"&gt;
                                                &lt;DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/&gt;
                                            &lt;/ObjectAnimationUsingKeyFrames&gt;
                                        &lt;/Storyboard&gt;
                                    &lt;/vsm:VisualState&gt;
                                    &lt;vsm:VisualState x:Name="Unfocused"/&gt;
                                &lt;/vsm:VisualStateGroup&gt;
                            &lt;/vsm:VisualStateManager.VisualStateGroups&gt;
                            &lt;Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}"&gt;
                                &lt;Grid&gt;
                                    &lt;Grid.ColumnDefinitions&gt;
                                        &lt;ColumnDefinition/&gt;
                                        &lt;ColumnDefinition/&gt;
                                    &lt;/Grid.ColumnDefinitions&gt;
                                    &lt;Grid.RowDefinitions&gt;
                                        &lt;RowDefinition/&gt;
                                        &lt;RowDefinition Height="10"/&gt;
                                    &lt;/Grid.RowDefinitions&gt;
                                    &lt;ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" Grid.ColumnSpan="2"/&gt;
                                    &lt;RepeatButton x:Name="IncreaseButton" IsTabStop="False" Template="{StaticResource IncreaseButtonTemplate}" Grid.Column="0" Grid.Row="1" ClickMode="Press"/&gt;
                                    &lt;RepeatButton x:Name="DecreaseButton" IsTabStop="False" Template="{StaticResource DecreaseButtonTemplate}" Grid.Column="1" Grid.Row="1" ClickMode="Press"/&gt;
                                &lt;/Grid&gt;
                            &lt;/Border&gt;
                            &lt;Border x:Name="DisabledVisualElement" IsHitTestVisible="false" Opacity="0" Background="#A5FFFFFF" CornerRadius="3"/&gt;
                            &lt;Border x:Name="FocusVisualElement" IsHitTestVisible="false" Visibility="Collapsed" BorderBrush="#FF45D6FA" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="1,1,1,1"/&gt;
                        &lt;/Grid&gt;
                    &lt;/ControlTemplate&gt;
                &lt;/Setter.Value&gt;
            &lt;/Setter&gt;
        &lt;/Style&gt;

    &lt;/UserControl.Resources&gt;
    &lt;StackPanel&gt;
        &lt;!-- Content --&gt;
        &lt;ContentControl Content="Default Template" Style="{StaticResource Header}" /&gt;
        &lt;Grid&gt;
            &lt;Grid.RowDefinitions&gt;
                &lt;RowDefinition Height="Auto"/&gt;
                &lt;RowDefinition Height="50"/&gt;
            &lt;/Grid.RowDefinitions&gt;
            &lt;Grid.ColumnDefinitions&gt;
                &lt;ColumnDefinition Width="200"/&gt;
                &lt;ColumnDefinition Width="200"/&gt;
                &lt;ColumnDefinition Width="200"/&gt;
            &lt;/Grid.ColumnDefinitions&gt;

            &lt;TextBlock Grid.Row="0" Grid.Column="0" Style="{StaticResource Description}" Text="No content"  FontWeight="Bold"/&gt;
            &lt;inputToolkit:ButtonSpinner Grid.Row="1" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10"/&gt;
            &lt;TextBlock Grid.Row="0" Grid.Column="1" Style="{StaticResource Description}" Text="Content Attribute"/&gt;
            &lt;inputToolkit:ButtonSpinner Grid.Row="1" Grid.Column="1" Margin="10"
                                 Content="Content Attribute" 
                                 HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;
            &lt;TextBlock Grid.Row="0" Grid.Column="2" Style="{StaticResource Description}" Text="Content Element"/&gt;
            &lt;inputToolkit:ButtonSpinner Grid.Row="1" Grid.Column="2" Margin="10"
                                 HorizontalAlignment="Center" VerticalAlignment="Center" 
                                 HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"&gt;
                &lt;Button Content="Content Element" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/&gt;
            &lt;/inputToolkit:ButtonSpinner&gt;
        &lt;/Grid&gt;

        &lt;!-- Horizontal Template --&gt;
        &lt;ContentControl Content="Horizontal Template" Style="{StaticResource Header}" /&gt;
        &lt;Grid&gt;
            &lt;Grid.RowDefinitions&gt;
                &lt;RowDefinition Height="Auto" /&gt;
                &lt;RowDefinition Height="50" /&gt;
            &lt;/Grid.RowDefinitions&gt;
            &lt;Grid.ColumnDefinitions&gt;
                &lt;ColumnDefinition Width="200"/&gt;
                &lt;ColumnDefinition Width="200"/&gt;
                &lt;ColumnDefinition Width="200"/&gt;
            &lt;/Grid.ColumnDefinitions&gt;

            &lt;TextBlock Grid.Row="0" Grid.Column="0" Style="{StaticResource Description}" Text="No content"  FontWeight="Bold"/&gt;
            &lt;inputToolkit:ButtonSpinner Style="{StaticResource ButtonSpinnerHorizontalStyle}" Grid.Row="1" Grid.Column="0" Margin="10" 
                                 HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;
            &lt;TextBlock Grid.Row="0" Grid.Column="1" Style="{StaticResource Description}" Text="Content Attribute"/&gt;
            &lt;inputToolkit:ButtonSpinner Style="{StaticResource ButtonSpinnerHorizontalStyle}" Grid.Row="1" Grid.Column="1" Margin="10" 
                                 Content="Content Attribute" 
                                 HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;
            &lt;TextBlock Grid.Row="0" Grid.Column="2" Style="{StaticResource Description}" Text="Content Element"/&gt;
            &lt;inputToolkit:ButtonSpinner Style="{StaticResource ButtonSpinnerHorizontalStyle}" Grid.Row="1" Grid.Column="2" 
                                 HorizontalAlignment="Center" VerticalAlignment="Center" 
                                 HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"&gt;
                &lt;Button Content="Content Element" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/&gt;
            &lt;/inputToolkit:ButtonSpinner&gt;
        &lt;/Grid&gt;

        &lt;!-- Vertical Template --&gt;
        &lt;ContentControl Content="Vertical Template" Style="{StaticResource Header}" /&gt;
        &lt;Grid&gt;
            &lt;Grid.RowDefinitions&gt;
                &lt;RowDefinition Height="Auto" /&gt;
                &lt;RowDefinition Height="100" /&gt;
            &lt;/Grid.RowDefinitions&gt;
            &lt;Grid.ColumnDefinitions&gt;
                &lt;ColumnDefinition Width="200" /&gt;
                &lt;ColumnDefinition Width="200" /&gt;
                &lt;ColumnDefinition Width="200" /&gt;
            &lt;/Grid.ColumnDefinitions&gt;

            &lt;TextBlock Grid.Row="0" Grid.Column="0" Style="{StaticResource Description}" Text="No content"  FontWeight="Bold"/&gt;
            &lt;inputToolkit:ButtonSpinner Style="{StaticResource ButtonSpinnerVerticalStyle}" Grid.Row="1" Grid.Column="0" Margin="10"
                                 HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;
            &lt;TextBlock Grid.Row="0" Grid.Column="1" Style="{StaticResource Description}" Text="Content Attribute"/&gt;
            &lt;inputToolkit:ButtonSpinner Style="{StaticResource ButtonSpinnerVerticalStyle}" Grid.Row="1" Grid.Column="1" Margin="10"
                                 Content="Content Attribute" 
                                 HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;
            &lt;TextBlock Grid.Row="0" Grid.Column="2" Style="{StaticResource Description}" Text="Content Element"/&gt;
            &lt;inputToolkit:ButtonSpinner Style="{StaticResource ButtonSpinnerVerticalStyle}" Grid.Row="1" Grid.Column="2" Margin="10"
                                 HorizontalAlignment="Center" VerticalAlignment="Center" 
                                 HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"&gt;
                &lt;Button Content="Content Element" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/&gt;
            &lt;/inputToolkit:ButtonSpinner&gt;
        &lt;/Grid&gt;

        &lt;!-- Other Template --&gt;
        &lt;ContentControl Content="Other Templates" Style="{StaticResource Header}" /&gt;
        &lt;Grid&gt;
            &lt;Grid.RowDefinitions&gt;
                &lt;RowDefinition Height="Auto" /&gt;
                &lt;RowDefinition Height="50" /&gt;
            &lt;/Grid.RowDefinitions&gt;
            &lt;Grid.ColumnDefinitions&gt;
                &lt;ColumnDefinition Width="200" /&gt;
                &lt;ColumnDefinition Width="200" /&gt;
            &lt;/Grid.ColumnDefinitions&gt;

            &lt;TextBlock Grid.Row="0" Grid.Column="0" Style="{StaticResource Description}" Text="Content on Right"/&gt;
            &lt;inputToolkit:ButtonSpinner Style="{StaticResource ButtonSpinnerLeftyStyle}" Grid.Row="1" Grid.Column="0" Margin="10"
                                 HorizontalAlignment="Center" VerticalAlignment="Center" 
                                 HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"&gt;
                &lt;Button Content="Content On Right"/&gt;
            &lt;/inputToolkit:ButtonSpinner&gt;
            &lt;TextBlock Grid.Row="0" Grid.Column="1" Style="{StaticResource Description}" Text="Content on Top"/&gt;
            &lt;inputToolkit:ButtonSpinner Style="{StaticResource ButtonSpinnerTopStyle}" Grid.Row="1" Grid.Column="1" Margin="10"
                                 HorizontalAlignment="Center" VerticalAlignment="Center" 
                                 HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"&gt;
                &lt;Button Content="Content On Top"/&gt;
            &lt;/inputToolkit:ButtonSpinner&gt;
        &lt;/Grid&gt;

        &lt;!-- Interactive Usage --&gt;
        &lt;ContentControl Content="Interactive Usage" Style="{StaticResource Header}" /&gt;
        &lt;Grid&gt;
            &lt;Grid.RowDefinitions&gt;
                &lt;RowDefinition Height="150"/&gt;
                &lt;RowDefinition Height="*"/&gt;
            &lt;/Grid.RowDefinitions&gt;
            &lt;Grid.ColumnDefinitions&gt;
                &lt;ColumnDefinition Width="75" /&gt;
                &lt;ColumnDefinition Width="75" /&gt;
                &lt;ColumnDefinition Width="250" /&gt;
            &lt;/Grid.ColumnDefinitions&gt;
            &lt;inputToolkit:ButtonSpinner x:Name="spinner1" BorderThickness="5" BorderBrush="Black" Style="{StaticResource ButtonSpinnerVerticalStyle}" Margin="5" Grid.Column="0"/&gt;
            &lt;inputToolkit:ButtonSpinner x:Name="spinner2" BorderThickness="5" BorderBrush="Red" Style="{StaticResource ButtonSpinnerHorizontalStyle}" Margin="5" Grid.Column="1"/&gt;
            &lt;ListBox x:Name="display" Grid.Column="2"/&gt;
        &lt;/Grid&gt;
    &lt;/StackPanel&gt;
&lt;/UserControl&gt;
</sys:String>
    </src:SourceFile.Source>
  </src:SourceFile>
  <src:SourceFile Path="ButtonSpinnerSample.xaml.cs">
    <src:SourceFile.Source>
      <sys:String>// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.

using System;
using System.Globalization;
using System.Windows.Controls;
using System.ComponentModel;

namespace System.Windows.Controls.Samples
{
    /// &lt;summary&gt;
    /// ButtonSpinner sample page.
    /// &lt;/summary&gt;
    [Sample("ButtonSpinner", DifficultyLevel.Basic)]
    [Category("ButtonSpinner")]
    public partial class ButtonSpinnerSample : UserControl
    {
        /// &lt;summary&gt;
        /// Initializes a new instance of the ButtonSpinnerSample class.
        /// &lt;/summary&gt;
        public ButtonSpinnerSample()
        {
            InitializeComponent();
            spinner1.Spin += (s, e) =&gt; { OnSpin(e); };
            spinner2.Spin += (s, e) =&gt; { OnSpin(e); };
        }

        /// &lt;summary&gt;
        /// Display the interactive ButtonSpinner control's properties.
        /// &lt;/summary&gt;
        /// &lt;param name="e"&gt;The SpinEventArgs.&lt;/param&gt;
        private void OnSpin(SpinEventArgs e)
        {
            string s = string.Format(CultureInfo.InvariantCulture, "SpinEventArgs.Direction: \t{0}", e.Direction);
            display.Items.Add(s);
            display.SelectedIndex = display.Items.Count - 1;
            Dispatcher.BeginInvoke(() =&gt; display.ScrollIntoView(s));
        }
    }
}</sys:String>
    </src:SourceFile.Source>
  </src:SourceFile>
  <src:SourceFile Path="ButtonSpinnerSample.xaml.vb">
    <src:SourceFile.Source>
      <sys:String>' (c) Copyright Microsoft Corporation.
' This source is subject to the Microsoft Public License (Ms-PL).
' Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
' All other rights reserved.

Imports Microsoft.VisualBasic
Imports System
Imports System.Globalization
Imports System.Windows.Controls
Imports System.ComponentModel

''' &lt;summary&gt;
''' ButtonSpinner sample page.
''' &lt;/summary&gt;
&lt;Sample("ButtonSpinner", DifficultyLevel.Basic), Category("ButtonSpinner")&gt; _
Partial Public Class ButtonSpinnerSample
    Inherits UserControl
    ''' &lt;summary&gt;
    ''' Initializes a new instance of the ButtonSpinnerSample class.
    ''' &lt;/summary&gt;
    Public Sub New()
        InitializeComponent()
    End Sub

    ' Declares a delegate for a method that takes in a String.
    Private Delegate Sub PropertyDisplayHandler(ByVal properties As String)

    ''' &lt;summary&gt;
    ''' Display the interactive ButtonSpinner control's properties.
    ''' &lt;/summary&gt;
    ''' &lt;param name="sender"&gt;The target ButtonSpinner&lt;/param&gt;
    ''' &lt;param name="e"&gt;The SpinEventArgs.&lt;/param&gt;
    Private Sub spinner_Spin(ByVal sender As Object, ByVal e As SpinEventArgs) Handles spinner1.Spin, spinner2.Spin
        Dim s As String = String.Format(CultureInfo.InvariantCulture, _
                                        "SpinEventArgs.Direction: " &amp; _
                                        Constants.vbTab &amp; "{0}", e.Direction)
        display.Items.Add(s)
        display.SelectedIndex = display.Items.Count - 1
        Dispatcher.BeginInvoke(New PropertyDisplayHandler(AddressOf ScrollPropertiesAsync), s)
    End Sub

    ''' &lt;summary&gt;
    ''' Handles the asynchronous display of the ButtonSpinner control's properties.
    ''' &lt;/summary&gt;
    ''' &lt;param name="properties"&gt;The properties to display.&lt;/param&gt;
    Private Sub ScrollPropertiesAsync(ByVal properties As String)
        display.ScrollIntoView(properties)
    End Sub
End Class</sys:String>
    </src:SourceFile.Source>
  </src:SourceFile>
</src:SourceViewer>
    </StackPanel>
</UserControl>
